// JavaScript Document
function dathang(id,quick,lang,title)
{
	if(title=='')title='Thông báo';
	

	LoadXmlDocPost('xml/dathang.php?id='+id+'&quick='+quick+'&lang='+lang,'','');	
ajaxwin=dhtmlwindow.open('ajaxbox', 'div', 'form_hoi_dat_hang',title, 'width=500px,height=100px,left='+((document.documentElement.clientWidth/2)-(150))+'px,top='+((document.documentElement.clientHeight/2)-(150))+'px,resize=0,scrolling=0');
	ajaxwin.moveTo('middle', 'middle');
}

function gokhoidonhang(id)
{
	LoadXmlDocPost('xml/gokhoidonhang.php?id='+id,'','');	
}

function view_pic(id)
{
	alert('test');
}

function setdisplay(className) 
  { 
	var arr = new Array(); 
	var elems = document.getElementsByTagName("*");
	for(var i = 0; i < elems.length; i++)
	{
	  var elem = elems[i];
	  var id = elem.getAttribute("id");
	  if (navigator.userAgent.indexOf("MSIE")>=0)
		{ var cls = elem.getAttribute("className");}
		else
		{ var cls = elem.getAttribute("class");	}
	  if(cls == className)
	  {
		arr[arr.length] = id;
		 elem.style.display="none";
	  }
	}
  }

function change_page(id,type)
{
	if(type==1)clearInterval ( picinter );
	setdisplay("anh");
	document.getElementById("anhblock"+id).style.display="block";
}

function interval_change_page(total,time)
{
page_i=0;

picinter=setInterval("if(page_i=="+total+"){page_i=0;};page_i++;change_page(page_i);",time  );
}

function view_vote(id,path)
{
	url='xml/thamdo_xemketqua.php?id='+id;
	var LeftPosition;
	var TopPosition;
	LeftPosition = (screen.width)/2-200;
	TopPosition = (screen.height)/2-200;
	newwindow=window.open(url,'name','height=300,width=500,top='+TopPosition+',left='+LeftPosition);
	if (window.focus) {newwindow.focus()}
	return false;
}


function change_detail_pic(id,picnum,ext)
{
	document.getElementById('detail_pic').src="userfiles/products/"+id+"/"+picnum+"."+ext;
}

