var cssFix = function(){

  var u = navigator.userAgent.toLowerCase(),

  is = function(t){return (u.indexOf(t)!=-1)};

  jQuery("html").addClass([

    (!(/opera|webtv/i.test(u))&&/msie (\d)/.test(u))?('ie ie'+RegExp.$1)

      :is('firefox/2')?'gecko ff2'

      :is('firefox/3')?'gecko ff3'

      :is('iexplore/6')?'ie6'

      :is('iexplore/7')?'ie7'

      :is('iexplore/8')?'ie8'

      :is('chrome/')?'google'

      :is('gecko/')?'gecko'

      :is('opera/9')?'opera opera9':/opera (\d)/.test(u)?'opera opera'+RegExp.$1

      :is('konqueror')?'konqueror'

      :is('applewebkit/')?'webkit safari'

      :is('mozilla/')?'gecko':'',

    (is('x11')||is('linux'))?' linux'

      :is('mac')?' mac'

      :is('win')?' win':''

  ].join(''));

}();


function checkEnter(e,caller) //e is event object passed from function invocation
{

    var characterCode //literal character code will be stored in this variable

    if(e && e.which ||e.which == 0)
    { //if which property of event object is supported (NN4)
        e = e
        characterCode = e.which //character code is contained in NN4's which property
    }
    else
    {
        e = event
        characterCode = e.keyCode //character code is contained in IE's keyCode property
    }
    
    if(characterCode == 13)//if generated character code is equal to ascii 13 (if enter key)
    {
        document.location= document.getElementById(caller).href
        return false
    }
    else
    {
        return true
    }
};


function chng(src, divOther, val)
{
	var div = document.getElementById(divOther);
	if (div== null)
		return;

	if (src.options[src.selectedIndex].text== val)
		div.style.display= 'inline';
	else
		div.style.display= 'none';
};

function ContactFormValidate(arguments)
{
	if (arguments.Value != null && arguments.Value!= '')
	{
		var div = document.getElementById('ctl00_divOtheTopicBlock');

		if (div!= null && div.style.display!= 'none')
		{
			var tbx = document.getElementById('ctl00_tbxOtherTopic');
			
			if (tbx!= null && tbx.value== '')
				return false
		}
	
		return true
	}
	else 
	{
		return false
	}
};

function checkFlash() 
	{
		if ((navigator.appName == "Microsoft Internet Explorer" 
			&& navigator.appVersion.indexOf("Mac") == -1 &&   navigator.appVersion.indexOf("3.1") == -1) 
			|| (navigator.plugins) && (navigator.plugins["Shockwave Flash"] || navigator.plugins["Shockwave Flash 2.0"]))
		{
			//Load a pre-defined HTML page with Flash Player in it into the browser window.
		}
	else 
	{
	    //Load a pre-defined HTML page without Flash Player into the browser window.
	    window.location=document.location.href+'?noflash=1'
	}
};
