// -----------------------------------------------------------
// Browser detection
// -----------------------------------------------------------
InternetExplorer = navigator.appName.indexOf("Microsoft") != -1;

  isNS6 = false;
  if (navigator.appName == "Netscape" && parseInt(navigator.appVersion) >= 5) {
    isNS6 = true;
  }

  isMacIE = false;
  if ((navigator.appVersion.indexOf("Mac") != -1) && (navigator.userAgent.indexOf("MSIE") != -1)) {
    isMacIE = true;
  }

function FindDivStyle(LAG)
{
	if(InternetExplorer == true)
	{		
		return document.all[""+LAG]
	}

	else
	{
		return document.getElementById(""+LAG)
	}
}

function ShowBlock(LAG)
{
		

	if(InternetExplorer == true)
	{
		//document.all[""+LAG].style.visibility = "visible"
		document.all[""+LAG].style.display = "BLOCK"
	}	
	else
	{
		document.getElementById(""+LAG).style.top = 0
		document.getElementById(""+LAG).style.visibility = 'visible'
		document.getElementById(""+LAG).style.display = 'Block'	

	}

}
function HideBlock(LAG)
{

	if(InternetExplorer == true)
	{
		//document.all[""+LAG].style.visibility= "hidden"
		document.all[""+LAG].style.display = "NONE"

	}

	else
	{
		document.getElementById(""+LAG).style.visibility = 'hidden'
		document.getElementById(""+LAG).style.display = 'none'		

	}


}

function OpenNewWindow(href,Titel,w,h)
{
 	window.open(href,Titel,"height="+ h +",width="+ w +",status=yes,toolbar=no,menubar=no,location=no");
}

function numeric_onkeypress(event) 
{
	var c;

	if ( document.all ) 
		c = event.keyCode;
	else
		c = event.charCode;

	keyvalid = ( ((c>47) && (c<58)) || (c==0) );

	if ( !keyvalid )
	{
		event.returnValue = false;

		if ( document.all )
			return false;

		event.preventDefault ();
		return false;
	}

	return true;
}

//Advanced Email Check credit-
//By JavaScript Kit (http://www.javascriptkit.com)
//Over 200+ free scripts here!

var testresults

function CheckEmail(email)
{
   var filter=/^([\w-]+(?:\.[\w-]+)*)@((?:[\w-]+\.)*\w[\w-]{0,66})\.([a-z]{2,6}(?:\.[a-z]{2})?)$/i
   if (filter.test(email))
   {
   	  testresults=true
   }
   else
   {
	   testresults=false
   }
   return (testresults)
}

// -----------------------------------------------------------
// Univeral method for javascript->flash setvariable
// -----------------------------------------------------------

/* -----------------------------------------------------------
----------Supporting Browsers----------
PC:
IE 5 and higher
Netscape 6 and higher
Moz/Firebird all
Opera 7 and higher

Mac OSX:
IE 5.2
Safari all
Netscape 6 and higher
Moz/Firebird/Camino all
Opera 6 and higher

Linux:
Konqueror assumed
----------------------------------------------------------- */



// -----------------------------------------------------------
// Detection snippet from http://www.dithered.com/javascript/browser_detect/index.html
// -----------------------------------------------------------
var ua        = navigator.userAgent.toLowerCase(); 
var is_pc_ie  = ( (ua.indexOf('msie') != -1 ) && ( ua.indexOf('win') != -1 ) && ( ua.indexOf('opera') == -1 ) && ( ua.indexOf('webtv') == -1 ) );



/* -----------------------------------------------------------
function setFlashVariables(movieid, flashquery)

movieid: id of object tag, name of movieid passed in through FlashVars
flashquery: querystring of values to set. example( var1=foo&var2=bar )
----------------------------------------------------------- */
function setFlashVariables(movieid, flashquery){
	var i,values;
	if(is_pc_ie){
		var chunk = flashquery.split("&");
		for(i in chunk){
			values = chunk[i].split("=");
			document[movieid].SetVariable(values[0],values[1]);
		}
	}else{
		var divcontainer = "flash_setvariables_"+movieid;
		if(!document.getElementById(divcontainer)){
			var divholder = document.createElement("div");
			divholder.id = divcontainer;
			document.body.appendChild(divholder);
		}
		document.getElementById(divcontainer).innerHTML = "";
		var divinfo = "<embed src='gateway.swf' FlashVars='lc="+movieid+"&fq="+escape(flashquery)+"' width='0' height='0' type='application/x-shockwave-flash'></embed>";
		document.getElementById(divcontainer).innerHTML = divinfo;
	}
}