// JavaScript Document
// JavaScript Document
//<!--

var currentTime=new Date();
	//alert(AddProduct);
function GetXmlHttpObject(handler)
{ 
	var objXmlHttp=null;

	if (navigator.userAgent.indexOf("MSIE")>=0)
	{ 
		var strName="Msxml2.XMLHTTP";
		if (navigator.appVersion.indexOf("MSIE 5.5")>=0)
		{
			strName="Microsoft.XMLHTTP";
		} 
		try
		{ 
			objXmlHttp=new ActiveXObject(strName);
			objXmlHttp.onreadystatechange=handler;
			return objXmlHttp;
		} 
		catch(e)
		{ 
			alert("Error. Scripting for ActiveX might be disabled");
			return;
		} 
	} 
	if (navigator.userAgent.indexOf("Mozilla")>=0)
	{
		objXmlHttp=new XMLHttpRequest();
		objXmlHttp.onload=handler;
		objXmlHttp.onerror=handler;
		return objXmlHttp;
	}
} 
function TypeChange(time)
{ 
	
		var id, type;
		id=1;
		type=document.getElementById('ddlPageType').value;								

		//alert(id);
		var url="indexScript.asp?act=change&page=" + id +"&type=" + type + "&time="+currentTime;

		//alert(url);
		xmlHttp=GetXmlHttpObject(stateChanged);
		xmlHttp.open("GET", url , true);
		xmlHttp.send(null);

		window.location ='#designs';
	
} 

function pageChange(time)
{ 
	
		var id, type;
		id=document.getElementById('ddlPage').value;								
		type=document.getElementById('ddlPageType').value;								
		//alert(id);
		var url="indexScript.asp?act=change&page=" + id +"&type=" + type + "&time="+currentTime;
		
		//alert(url);
		xmlHttp=GetXmlHttpObject(stateChanged);
		xmlHttp.open("GET", url , true);
		xmlHttp.send(null);
		window.location ='#designs';
	
} 
function moveNext(time)
{ 
	
		var id, type;
		id=document.getElementById('ddlPage').value;
		id = parseInt(id) + 1;
		type=document.getElementById('ddlPageType').value;								
		
		var url="indexScript.asp?act=change&page=" + id +"&type=" + type + "&time="+currentTime;
		
		//alert(url);
		xmlHttp=GetXmlHttpObject(stateChanged);
		xmlHttp.open("GET", url , true);
		xmlHttp.send(null);
		window.location ='#designs';
	
} 
function moveBack(time)
{ 
	
		var id, type;
		id=document.getElementById('ddlPage').value;	
		id = parseInt(id) - 1;
		type=document.getElementById('ddlPageType').value;								
		
		var url="indexScript.asp?act=change&page=" + id +"&type=" + type + "&time="+currentTime;
		
		//alert(url);
		xmlHttp=GetXmlHttpObject(stateChanged);
		xmlHttp.open("GET", url , true);
		xmlHttp.send(null);
		window.location ='#designs';
	
} 
function FillData()
{ 
	
	var url="indexScript.asp?act=loadData&dsType=all&time="+currentTime;
	xmlHttp=GetXmlHttpObject(stateChanged);
	xmlHttp.open("GET", url , true);
	xmlHttp.send(null);
	
	
} 

function stateChanged() 
{ 
	//alert(xmlHttp.readyState);
	var s,ss;
	if (xmlHttp.readyState==4 || xmlHttp.readyState=="complete")
	{

		s = xmlHttp.responseText;
		ss = s.split("__,__");						

		document.getElementById('listPage').innerHTML=ss[0];
		
			
			//document.getElementById('edit').innerHTML="";
				
		
		
		
	}
	currentTime=new Date();

} 


