var xmlHttp


function savepoll(form1)
{
	
	
xmlHttp=GetXmlHttpObject();
if (xmlHttp==null)
  {
  alert ("Your browser does not support AJAX!");
  return;
  } 
else
	{
		document.getElementById("txtsendstatus").style.display="none";
		document.getElementById("txtsendstatus2").style.display="block";
	}
	
	
	var title		= form1.title.value;
	var name		= form1.myname.value;
	var email		= form1.myemail.value;
	var message    	= form1.mymessage.value;
	var sendto   	= form1.Message.value;
	var state		= form1.mystate.value;
	var country 	= form1.mycountry.value;
	var address 	= form1.myaddress.value;
	var phone 		= form1.mymobile.value;
	var sequence    = form1.sequence.value;
	var notify =	 form1.notifyme.value;
	var notify;
	
   /*for (var i=0; i < form1.notify.length; i++)
   {
      if (form1.notify[i].checked)
      {
          notify = form1.notify[i].value;
      }
   }*/
   
	var bgm = form1.backgroundmusic.value;
	var pid = form1.pid.value;
		
var url="getresult.php";
var params="qcase=2";
params=params+"&title="+escape(title);
params=params+"&name="+escape(name);
params=params+"&email="+escape(email);
params=params+"&message="+escape(message);
params=params+"&sendto="+escape(sendto);
params=params+"&state="+state;
params=params+"&country="+country;
params=params+"&address="+escape(address);
params=params+"&phone="+phone;
params=params+"&sequence="+sequence;
params=params+"&notify="+notify;
params=params+"&bgm="+bgm;
params=params+"&pid="+pid;


xmlHttp.onreadystatechange=listsaved;
xmlHttp.open("POST",url,true);
xmlHttp.setRequestHeader("Content-type", "application/x-www-form-urlencoded");
xmlHttp.setRequestHeader("Content-length", params.length);
xmlHttp.setRequestHeader("Connection", "close");
xmlHttp.send(params);


}

function resendcard(form1)
{
xmlHttp=GetXmlHttpObject();
if (xmlHttp==null)
  {
  alert ("Your browser does not support AJAX!");
  return;
  } 
else
	{
		document.getElementById("txtsendstatus").style.display="none";
		document.getElementById("txtsendstatus2").style.display="block";
	}
		
	var sendto   	= form1.Message.value;
	var uid 		= form1.uid.value;
	var pcode 		= form1.pcode.value;
	
		
var url="getresult.php";
var params="qcase=1";
params=params+"&sendto="+sendto;
params=params+"&pcode="+pcode;
params=params+"&uid="+uid;

xmlHttp.onreadystatechange=listresaved;
xmlHttp.open("POST",url,true);
xmlHttp.setRequestHeader("Content-type", "application/x-www-form-urlencoded");
xmlHttp.setRequestHeader("Content-length", params.length);
xmlHttp.setRequestHeader("Connection", "close");
xmlHttp.send(params);
}

function getsenderinfo(form1)
{
xmlHttp=GetXmlHttpObject();
if (xmlHttp==null)
  {
  alert ("Your browser does not support AJAX!");
  return;
  } 
		
	var uid 		= form1.uid.value;
	var pcode 		= form1.pcode.value;
	
		
var url="getresult.php";
var params="qcase=3";
params=params+"&pcode="+pcode;
params=params+"&uid="+uid;

xmlHttp.onreadystatechange=listChanged;
xmlHttp.open("POST",url,true);
xmlHttp.setRequestHeader("Content-type", "application/x-www-form-urlencoded");
xmlHttp.setRequestHeader("Content-length", params.length);
xmlHttp.setRequestHeader("Connection", "close");
xmlHttp.send(params);
	
}

function listresaved()
{
if (xmlHttp.readyState==4)
{ 
  if (xmlHttp.status == 200) {

		document.getElementById("lightboxContent_step1").style.display="none";
		document.getElementById("lightboxContent_step2").style.display="none";
		document.getElementById("lightboxContent_step3").style.display="none";
		document.getElementById("lightboxContent_step4").style.display="none";
		document.getElementById("lightboxContent_step5").style.display="none";
		document.getElementById("lightboxContent_step6").style.display="block";
		//document.getElementById("blog_tq").style.display="block";

		document.contact2.userid.value = xmlHttp.responseText.replace(/^\s+|\s+$/g, '');

		if (document.contact2.shareid.value == 2 )
		{
		showfacebook();
		}
		else if (document.contact2.shareid.value == 3 )
		{
		showblogit();
		}
		else
		{
		showemail();	
		}

  } else {
	  alert("Whoops!! We've detected an error on the server. Please try again later." +xmlHttp.status+ xmlHttp.responseText);
  }

}
}


function listsaved()
{
if (xmlHttp.readyState==4)
{ 
  if (xmlHttp.status == 200) {

		document.getElementById("lightboxContent_step1").style.display="none";
		document.getElementById("lightboxContent_step2").style.display="none";
		document.getElementById("lightboxContent_step3").style.display="none";
		document.getElementById("lightboxContent_step4").style.display="none";
		document.getElementById("lightboxContent_step5").style.display="none";
		document.getElementById("lightboxContent_step6").style.display="block";
		//document.getElementById("blog_tq").style.display="block";

		document.contact2.userid.value = xmlHttp.responseText.replace(/^\s+|\s+$/g, '');

		if (document.contact2.shareid.value == 2 )
		{
		showfacebook();
		}
		else if (document.contact2.shareid.value == 3 )
		{
		showblogit();
		}
		else
		{
		showemail();	
		}

		document.getElementById("blogitsnippet").innerHTML = "&lt;object classid=\"clsid:d27cdb6e-ae6d-11cf-96b8-444553540000\" codebase=\"http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=9,0,0,0\" width=\"100%\" height=\"100%\" id=\"loader\" align=\"middle\"&gt;"
	+ "&lt;param name=\"allowScriptAccess\" value=\"always\" /&gt;"
	+ "&lt;param name=\"allowFullScreen\" value=\"true\" /&gt;"
	+ "&lt;param name=\"movie\" value=\"http://www.rojaksong.com.my/rojak_blog.swf\" /&gt;&lt;param name=\"quality\" value=\"high\" /&gt;&lt;param name=\"bgcolor\" value=\"#ffffff\" /&gt;"
	+ "&lt;param name=\"wmode\" value=\"transparent\" /&gt;	"
	+ "&lt;param name=\"FlashVars\" value=\"id=&uid="+xmlHttp.responseText.replace(/^\s+|\s+$/g, '')+"\"/&gt;"
	+ "&lt;embed src=\"http://www.rojaksong.com.my/rojak_blog.swf\" FlashVars=\"id=&uid="+xmlHttp.responseText.replace(/^\s+|\s+$/g, '')+"\" width=\"100%\" height=\"100%\" align=\"middle\" quality=\"high\" bgcolor=\"#ffffff\" name=\"loader\" allowScriptAccess=\"always\" allowFullScreen=\"true\" type=\"application/x-shockwave-flash\" pluginspage=\"http://www.macromedia.com/go/getflashplayer\" wmode=\"transparent\" /&gt;"
  + "&lt;/object&gt;";
  
  
document.getElementById("fburl").href ="http://www.facebook.com/sharer.php?u=http://www.rojaksong.com.my/index.php?uid="+xmlHttp.responseText.replace(/^\s+|\s+$/g, '')+"&t=Rojak%20&ndash;%20A%20Malaysian%20Love%20Song"; 

document.getElementById("fburl2").href ="http://www.facebook.com/sharer.php?u=http://www.rojaksong.com.my/index.php?uid="+xmlHttp.responseText.replace(/^\s+|\s+$/g, '')+"&t=Rojak%20&ndash;%20A%20Malaysian%20Love%20Song"; 

document.getElementById("fburl3").href ="http://www.facebook.com/sharer.php?u=http://www.rojaksong.com.my/index.php?uid="+xmlHttp.responseText.replace(/^\s+|\s+$/g, '')+"&t=Rojak%20&ndash;%20A%20Malaysian%20Love%20Song"; 
					
  } else {
	  alert("Whoops!! We've detected an error on the server. Please try again later." +xmlHttp.status+ xmlHttp.responseText);
  }

}
}


function listChanged() 
{ 

if (xmlHttp.readyState==4)
	{ 
		document.getElementById("content_form").innerHTML=xmlHttp.responseText;
		
		var email1 = document.getElementById("emailurl");
		var email2 = document.getElementById("emailurl2");
		//email1.setAttribute('onClick', "showSection(10)"); 
		//email2.setAttribute('onClick', "showSection(10)"); 


		document.getElementById("lightboxContent_step1").style.display="none";
		document.getElementById("lightboxContent_step2").style.display="block";
		document.getElementById("lightboxContent_step3").style.display="none";
		document.getElementById("lightboxContent_step4").style.display="none";
		document.getElementById("lightboxContent_step5").style.display="none";
		document.getElementById("lightboxContent_step6").style.display="none";
	}
}


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;
}