// JavaScript Document
function ChangBackGound(FeildName,bgcolor)
{
FeildName.style.background = bgcolor;	
}

function NewWindow(Url,Title,Wh,Hh,Lt,Tp)
{
	winObj=window.open(Url,'Title',"status=0,toolbar=0,scrollbars=0,titlebar=0,menubar=0,resizable=0,width="+Wh+",height="+Hh+",directories=0,location=0");
	winObj.moveTo(Lt,Tp); 	
	winObj.focus();
}


function NewWindowWithoutSize(Url,Title)
{
	winObj=window.open(Url,'Title',"status=0,toolbar=0,scrollbars=1,titlebar=0,menubar=0,resizable=1,directories=0,location=0");
	winObj.focus();
}


function NewWindowResizable(Url,Title,Wh,Hh,Lt,Tp)
{
	winObj=window.open(Url,'Title',"status=0,toolbar=0,scrollbars=1,titlebar=0,menubar=0,resizable=1,width="+Wh+",height="+Hh+",directories=0,location=0");
	winObj.moveTo(Lt,Tp); 	
	winObj.focus();
}

function CheckField(contactusform,myemail)
{
	 if (document.getElementById('Position').value =='')
	 	{
		   alert ('Please enter your position');
		   contactusform.Position.focus();
		   return false;
		 }
	 if (document.getElementById('Telephone').value =='')
	 	{
			alert ('Please enter your telephone number');
			contactusform.Telephone.focus();
			return false;
		}
	 
	if(!checkemail(myemail)) return false;
}

function checkemail(myemail) 
{
if (/^\w+([\.-]?\w+)*@\w+([\.-]?\w+)*(\.\w{2,3})+$/.test(myemail.value)){return (true)}
if (myemail.value !=''){alert("Your Email is'nt Correct")}
if (myemail.value ==''){alert("Please enter your mail")}
return (false)
}

function SwapImage(OldImage,NewImage,Src)
{
	OldImage.src=Src+'/'+NewImage;
}

function LoadImageInDiv(DivName,ImageAddress,WidthImage,HeightImage)
{
	DivName.style.background='url('+ImageAddress+')';
	DivName.style.width=WidthImage;
	DivName.style.height=HeightImage;
}



function NewsletterAsk(Email)
{
	
  var xmlHttp;
	try
	  {
	  // Firefox, Opera 8.0+, Safari
	  xmlHttp=new XMLHttpRequest();
	  }
	catch (e)
	  {
	  // Internet Explorer
	  try
		{
		xmlHttp=new ActiveXObject("Msxml2.XMLHTTP");
		}
	  catch (e)
		{
		try
		  {
		  xmlHttp=new ActiveXObject("Microsoft.XMLHTTP");
		  }
		catch (e)
		  {
		  alert("Your browser does not support AJAX!");
		  return false;
		  }
		}
	  }
	 

   xmlHttp.open("post","NewsletterAsk.php",true);
   xmlHttp.onreadystatechange=function()
    {
    if(xmlHttp.readyState==4)
      {
		
		document.getElementById("echoresult").innerHTML = xmlHttp.responseText;
		
		document.getElementById("NewsletterForm").style.display = 'none';
      }
    } 
 xmlHttp.setRequestHeader('Content-Type', 'application/x-www-form-urlencoded');
 xmlHttp.send('Email='+ Email);

  }
  
  
  
  function CheckAll(CheckId)
  {
	
	boxLength = CheckId.length;
	for ( i=0; i < boxLength; i++ ) {
        CheckId[i].checked = true;
      }
  }
  
  function ClearAll(CheckId)
  {
	
	boxLength = CheckId.length;
	for ( i=0; i < boxLength; i++ ) {
        CheckId[i].checked = false;
      }
  }
  
  
  function InsertSurveyA(RFOL,Lang,SQRFOL)
{
	
  var xmlHttp;
	try
	  {
	  // Firefox, Opera 8.0+, Safari
	  xmlHttp=new XMLHttpRequest();
	  }
	catch (e)
	  {
	  // Internet Explorer
	  try
		{
		xmlHttp=new ActiveXObject("Msxml2.XMLHTTP");
		}
	  catch (e)
		{
		try
		  {
		  xmlHttp=new ActiveXObject("Microsoft.XMLHTTP");
		  }
		catch (e)
		  {
		  alert("Your browser does not support AJAX!");
		  return false;
		  }
		}
	  }
	
	for( i = 0; i < RFOL.length; i++ )
		{
		if( RFOL[i].checked == true )
			ValRFOL = RFOL[i].value;
		}
		

   xmlHttp.open("post","InsertSurverUserIdea.php",true);
   xmlHttp.onreadystatechange=function()
    {
    if(xmlHttp.readyState==4)
      {
		
		document.getElementById("SRSendUserIdea").innerHTML = xmlHttp.responseText;
		
		document.getElementById("SendIdea").style.display = 'none';
      }
    } 
 xmlHttp.setRequestHeader('Content-Type', 'application/x-www-form-urlencoded');
// params="name="+nam+"pass="+pas;//cancatenation
 xmlHttp.send('RFOL='+ ValRFOL+'&Lang='+ Lang+'&SQRFOL='+ SQRFOL);

  }
  


  function InsertJustSurveyA(RFOL,Lang,SQRFOL)
{
	
  var xmlHttp;
	try
	  {
	  // Firefox, Opera 8.0+, Safari
	  xmlHttp=new XMLHttpRequest();
	  }
	catch (e)
	  {
	  // Internet Explorer
	  try
		{
		xmlHttp=new ActiveXObject("Msxml2.XMLHTTP");
		}
	  catch (e)
		{
		try
		  {
		  xmlHttp=new ActiveXObject("Microsoft.XMLHTTP");
		  }
		catch (e)
		  {
		  alert("Your browser does not support AJAX!");
		  return false;
		  }
		}
	  }
	
	for( i = 0; i < RFOL.length; i++ )
		{
		if( RFOL[i].checked == true )
			ValRFOL = RFOL[i].value;
		}
		

   xmlHttp.open("post","InsertJustSurverUserIdea.php",true);
   xmlHttp.onreadystatechange=function()
    {
    if(xmlHttp.readyState==4)
      {
		
		document.getElementById("SSRSendUserIdea").innerHTML = xmlHttp.responseText;
		
		document.getElementById("SSendIdea").style.display = 'none';
      }
    } 
 xmlHttp.setRequestHeader('Content-Type', 'application/x-www-form-urlencoded');
// params="name="+nam+"pass="+pas;//cancatenation
 xmlHttp.send('RFOL='+ ValRFOL+'&Lang='+ Lang+'&SQRFOL='+ SQRFOL);

  }
  
  
  function getMyDivHeight() {
  var LeftHeight = document.getElementById("left").clientHeight;
  var RightHeight = document.getElementById("right").clientHeight;
  var ProductRight = document.getElementById("productright").clientHeight;
  var divheight = Math.max(LeftHeight,RightHeight,ProductRight);
  document.getElementById("left").style.height = divheight;
  document.getElementById("right").style.height = divheight;
  document.getElementById("productright").style.height = divheight;
  
}
  



