// JavaScript Document

function resizefrm(height){
var iframeElement = parent.document.getElementById('frmlogin'); 
iframeElement.style.height = height; //100px or 100% 
}

function forget_pws(){
 cusuwinpopup=window.open('/get_lostpass.php','','toolbar=no,location=no,directories=no,menubar=no,status=yes,scrollbars=yes,resizable=no,width=350,height=190');
			}
			
			function sendm2f(postid){

						  var w=490,h=200;
						  w += 32;
						  h += 96;
						  wleft = (screen.width - w) / 2;
						  wtop = (screen.height - h) / 2;
						  var win = window.open('/sendm2f.php?url='+postid,'','width=' + w + ', height=' + h + ', ' +'left=' + wleft + ', top=' + wtop);

						  win.resizeTo(w, h);

						  win.moveTo(wleft, wtop);
						  win.focus();
					}
					
					
					function myfavorites(url){
						  var w=555,h=290;
						  w += 32;
						  h += 96;
						  wleft = (screen.width - w) / 2;
						  wtop = (screen.height - h) / 2;
						  var win = window.open('/forvarites_add.php?url=http://www.checkprice.net'+url,'','width=' + w + ', height=' + h + ', ' +'left=' + wleft + ', top=' + wtop);

						  win.resizeTo(w, h);

						  win.moveTo(wleft, wtop);
						  win.focus();
					}
                    

/*var timeout;//	old
function RandomImg()
{
    if(timeout) clearTimeout(timeout); 
       
    var mydate = new Date(); 
    var seconds = mydate.getSeconds();
    var img = new Array();  
    var imgalt = new Array();  
	var imglink = new Array();
    
    img[1] = "/banner/_b_netregis.gif";
	img[0] = "/banner/_b_netregis.gif";
    img[2] = "/banner/_b_netregis.gif";
	

	imglink[1] = "http://www.netregis.com";
	imglink[0] = "http://www.netregis.com";
    imglink[2] = "http://www.netregis.com";
	
    imgalt[1] = "จดโดเมน hosting";
	imgalt[0] = "จดโดเมน hosting";
    imgalt[2] = "จดโดเมน hosting";

                               
    seconds = seconds % 2;
    
    document.getElementById("banner_head").src=img[seconds];
    document.getElementById("banner_head").alt=imgalt[seconds];
    document.getElementById("Abanner_head").href=imglink[seconds];
    
    timeout = setTimeout("RandomImg()",14200); //30seconds7000
}*/
var seconds=0;
function RandomImg()
{
	var timeout=0;
    if(timeout) clearTimeout(timeout); 
    var img = new Array();  
	var imgalt= new Array();
	var imgtitle= new Array();
	var imglink = new Array();
	
    img[0] = "http://www.checkprice.net/banner/NOKIA_pro.gif"; 
	//img[0] = "http://www.checkprice.net/banner/savepay_auctions.jpg"; 
	//img[1] = "http://www.checkprice.net/banner/banner-TEO.jpg"; 
   // img[1] = "/banner/b_netregis.gif";
	//img[0] = "/banner/checkprice.swf"; ใส่ Flash
	
	imgalt[0] = "Hosting";
	//imgalt[0] = "ประมูลสินค้า&nbsp;SavePay&nbsp;Auctions";
	//imgalt[1] = "event&nbsp;organizer";
	//imgalt[1] = "จดโดเมน&nbsp;hosting";
	//imgalt[0] = "จดโดเมน&nbsp;hosting";

	imgtitle[0] = "Hosting";
	//imgtitle[0] = "ประมูลสินค้า&nbsp;SavePay&nbsp;Auctions";
	//imgtitle[1] = "event&nbsp;organizer";
	
	imglink[0] = "http://www.netregis.com";
	//imglink[0] = "http://savepay.net/auctions/";
	//imglink[1] = "http://www.thaieventorganizer.com";
	
	if(seconds>=1){//ถ้าไม่random
		seconds=0;
	}else{
		seconds++;
	}
	
 	//seconds=Math.floor(Math.random()*2);
	var type_banner=img[seconds].substr(img[seconds].length-3);
	//alert(type_banner);<a href='http://www.netregis.com'></a>
	if(type_banner=="jpg" || type_banner=="gif"){
	var myobject="<a href="+imglink[seconds]+" target=blank ><img src="+img[seconds]+" alt="+imgalt[seconds]+" title="+imgtitle[seconds]+" border=0    width=612 height=150 /></a>";
		document.getElementById("mybanner").innerHTML=myobject;
	}else{
	var myobject="<object id=myflash classid=clsid:D27CDB6E-AE6D-11cf-96B8-444553540000 ";
	myobject+="codebase=http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=7,0,19,0 width=440 height=70>";
  myobject+="<param name=movie value="+img[seconds]+" />";
  myobject+="<param name=quality value=high />";
  myobject+="<embed src=/banner/checkprice.swf quality=high pluginspage=http://www.macromedia.com/go/getflashplayer type=application/x-shockwave-flash width=440 height=70></embed>";
myobject+="</object>";	
		document.getElementById("mybanner").innerHTML=myobject;	
	}
//   var me=document.getElementById("myflash").movie=img[seconds];;     
    timeout=setTimeout("RandomImg()",6500); //30seconds7000

}
function submit_newproStep()
{
	document.getElementById("Step_one").disabled=true;
	document.getElementById("addnew_pro").submit();
}

function chkmorebrand()
{
	if(confirm("คุณแน่ใจที่จะเปลี่ยนเป็นยี่ห้อที่เลือกจริงหรือ?"))
	{
	document.getElementById("addnew_pro").submit();
	}
}

var c_exps = "";
		function explandsub(id)
		{
			if(id != c_exps)
			{
				document.getElementById("exp"+id).style.display='block';
				c_exps = id;
			}
			else
			{
				document.getElementById("exp"+id).style.display='none';
				c_exps = '';
			}
			
		}
	
	function zoompic(evt,img)
	{
		document.getElementById("zoom_propicin").style.display=evt;
		document.getElementById("zoomimg").src='/img_product/'+img;
	}

function overc(id) {
		document.getElementById(id).className = id;
	}
		function outc(id) {
		document.getElementById(id).className = '';
	}