
	function popUpWindow(URL,toolbar,scrollbars,fullscreen,statusbar,menubar,resizable,left,top,width,height) {
		eval("window.open(URL, 'mywin','toolbar="+toolbar+",scrollbars="+scrollbars+",location=0,fullscreen="+fullscreen+",statusbar="+statusbar+",menubar="+menubar+",resizable="+resizable+",left = "+left+",top = "+top+", width="+width+",height="+height+"');");
	}

	function getContactInfo()
	{ 
		xmlHttp=GetXmlHttpObject()
		if (xmlHttp==null)
		 {
			 alert ("Browser does not support HTTP Request")
			 return
		 }
		
		var name=trimspaces(document.getElementById('name').value);
		var email=trimspaces(document.getElementById('email').value);
		var country=trimspaces(document.getElementById('country').value);
		var subject=trimspaces(document.getElementById('subject').value);
		var vstring=trimspaces(document.getElementById('verify_box').value);
		var message=trimspaces(document.getElementById('message').value);
		
		if(name=='')
		{
			alert('Please enter your name.');
			document.getElementById('name').focus();
			return false;
		}
		if(email=='')
		{
			alert('Please enter your email.');
			document.getElementById('email').focus();
			return false;
		}
		if (/^\w+([\.-]?\w+)*@\w+([\.-]?\w+)*(\.\w{2,3})+$/.test(email))
		{}
		else
		{
			alert('Invalid E-mail Address! Please re-enter.');
			document.getElementById('email').focus();
			return false;
		}
		if(subject=='')
		{
			alert('Please enter your subject.');
			document.getElementById('subject').focus();
			return false;
		}
		
		if(vstring=='')
		{
			alert('Please enter verify string.');
			document.getElementById('verify_box').focus();
			return false;
		}
		if(message=='')
		{
			alert('Please enter your message.');
			document.getElementById('message').focus();
			return false;
		}
		var url="contact-information.php?name="+name+"&email="+email+"&subject="+escape(subject)+"&message="+escape(message)+"&country="+country+"&vstring="+vstring;
		xmlHttp.onreadystatechange=contactInfo
		xmlHttp.open("GET",url,true)
		xmlHttp.send(null)
	}
	
	function contactInfo() 
	{ 
		 if (xmlHttp.readyState==4 || xmlHttp.readyState=="complete")
		 { 	 
			if(xmlHttp.responseText=="error")
			{
				document.getElementById("contactInfo").style.display='none';
				document.getElementById("cform").style.display='';
				//document.getElementById("errorRow").style.display='';
				document.getElementById("errorInfo").style.display='';
			}
			else
			{
				document.getElementById("cform").style.display='none';
				document.getElementById("contactInfo").style.display='';
				document.getElementById("contactInfo").innerHTML='<span style="color:#000000;">'+xmlHttp.responseText+'</span>';
			}
			
		} 
		else 
		{
			document.getElementById("contactInfo").style.display='';
			document.getElementById("contactInfo").innerHTML="<div align='center' style='padding-top:120px;'><img src='member/images/loader.gif' border='0'  height='20' width='20'></div>";
			document.getElementById("cform").style.display='none';
		}
	}
	function getInfo()
	{ 
		xmlHttp=GetXmlHttpObject()
		if (xmlHttp==null)
		 {
			 alert ("Browser does not support HTTP Request")
			 return
		 }
		
		var name=document.getElementById('optinName').value;
		var email=document.getElementById('optinEmail').value;
		var phone=document.getElementById('optinPhone').value;
		var country=document.getElementById('optinCountry').value;
		var pos=document.getElementById('position').value;
		
		if(name=='')
		{
			alert('Please enter your name.');
			document.getElementById('optinName').focus();
			return false;
		}
		if(email=='')
		{
			alert('Please enter your email address.');
			document.getElementById('optinEmail').focus();
			return false;
		}
		if (/^\w+([\.-]?\w+)*@\w+([\.-]?\w+)*(\.\w{2,3})+$/.test(email))
		{}
		else
		{
			alert('Invalid E-mail Address! Please re-enter.');
			document.getElementById('optinEmail').focus();
			return false;
		}
		if(phone=='')
		{
			alert('Please enter your phone number.');
			document.getElementById('optinPhone').focus();
			return false;
		}
		if(phone!='')
		{
			if(isNaN(phone))
			{
				alert('Please enter numeric value.');
				document.getElementById('optinPhone').focus();
				return false;
			}
		}
		if(country=='')
		{
			alert('Please enter your country.');
			document.getElementById('optinCountry').focus();
			return false;
		}
		var url="optin-information.php?name="+name+"&email="+email+"&phone="+phone+"&country="+country+"&pos="+pos;
		//alert(url);
		xmlHttp.onreadystatechange=optIn
		xmlHttp.open("GET",url,true)
		xmlHttp.send(null)
	}
	function redirect(val)
	{
		if(val=='center')
		document.location.href="compensation.php";
		else if(val=='right')
		document.location.href="compensation.php";
	}
	function optIn() 
	{ 
		if (xmlHttp.readyState==4 || xmlHttp.readyState=="complete")
		 { 
			var response = xmlHttp.responseText.split("|");
			document.getElementById("messageshow").style.display='';
			document.getElementById("messageshow").innerHTML='<span style="color:#000000;">'+response[0]+'</span>' ;
			document.getElementById('optinName').value='';
			document.getElementById('optinEmail').value='';
			document.getElementById('optinCountry').value='';
			document.getElementById('optinPhone').value='';
			setTimeout("redirect('"+response[1]+"')",1000);
		 } 
		 else
		 {
		 	document.getElementById("messageshow").innerHTML="<div align='center' style='padding-top:120px;'><img src='member/images/loader.gif' border='0'  height='20' width='20'></div>";
		 }
		
	}
	function GetXmlHttpObject()
	{
		var xmlHttp=null;
		try
		 {
		 // Firefox, Opera 8.0+, Safari
		 xmlHttp=new XMLHttpRequest();
		 }
		catch (e)
		 {
		 //Internet Explorer
		 try
		  {
		  xmlHttp=new ActiveXObject("Msxml2.XMLHTTP");
		  }
		 catch (e)
		  {
		  xmlHttp=new ActiveXObject("Microsoft.XMLHTTP");
		  }
		 }
		return xmlHttp;
   }


// make signups scroll
$(function(){
	var containerElm = $('div.signupList').get();
	var containerHeight = $('div.signupList').height();
	var contentHeight = $('div.signupList table').height();
	var scrollSpeed = (contentHeight - containerHeight) * 100;

	function up(){
		var offset = 0;
		$('div.signupList').animate({scrollTop: offset}, scrollSpeed, 'linear', function(){
			down(); // private method
		});			
	}
	function down(){
		var offset = contentHeight - containerHeight;
		$('div.signupList').animate({scrollTop: offset}, scrollSpeed, 'linear', function(){
			up(); // private method
		});			
	}

	if(contentHeight - containerHeight > 50){
		// only start scrolling if there is something to scroll
		down();
	}
});
