var gmObj = false;
try{
	gmObj = new ActiveXObject("Msxml2.XMLHTTP");
}catch(e)
{
	try{
		gmObj = new ActiveXObject("Microsoft.XMLHTTP");
	}catch(e2){
		gmObj = false;
	}
}

if(!gmObj && typeof XMLHttpRequest != 'undefined')
{
	gmObj = XMLHttpRequest();
}

function geturl(sendUrl,id){
	gmObj.open("GET",sendUrl,true);
	gmObj.onreadystatechange = updatePage;
	gmObj.send(null);
}

function updatePage(){
	if(gmObj.readyState == 4)
	{
		var response = gmObj.responseText;
		document.getElementById(obj).innerHTML = response;
	}
	else
	{
		//document.getElementById(obj).innerHTML = 'loading';
	}
}

function addlove(id){
	id = id;
	obj = 'alerttext'+id;
	var url="addlove.php?id="+id;
	geturl(url,id);
}

function serachword(v){
	document.getElementById().value = v;
}

function addfavo(uid,sid){
	obj = 'isfavo';
	var url="addfavo.php?uid="+uid+"&sid="+sid;
	geturl(url);
}

function checkuser(username){
	obj = 'usertext';
	var url="ajax.php?username="+encodeURIComponent(username);
	geturl(url);
}

function checkemail(v){
	if(!v.match( /^([a-zA-Z0-9]+[_|\-|\.]?)*[a-zA-Z0-9]+@([a-zA-Z0-9]+[_|\-|\.]?)*[a-zA-Z0-9]+\.[a-zA-Z]{2,3}$/ )){
		$H("emailtext","<img id='chkemailimg' src='images/wrong.jpg'>");
		return false;
	}
	$H("emailtext","<img id='chkemailimg' src='images/right.jpg'>");
	
	obj = 'emailtext';
	var url="ajax.php?email="+v;
	geturl(url);
}

function showimg(imgs){
	document.getElementById('productimg').src = imgs;
}