document.write("<script src='js/validator.js' type='text/javascript' language='javascript'></script>");
document.write("<script src='js/swfobject_source.js' type='text/javascript' language='javascript'></script>");

// 加载后执行的代码
function regetImage(obj) {
    var today = new Date();
	var today_ms = ""
		+ today.getFullYear() + (today.getMonth() + 1) + today.getDate()
		+ today.getMinutes() + today.getSeconds() + today.getMilliseconds();
    obj.src = '../include/auth/getimage.php?' + today_ms;
}



function bookmarkit()
 {window.external.addFavorite(location.href,document.title);}


function setHomepage(pageURL) {
    if (document.all) {
        document.body.style.behavior='url(#default#homepage)';
        document.body.setHomePage(pageURL);
    }
    else if (window.sidebar) {
        if(window.netscape) {
            try {
                netscape.security.PrivilegeManager.enablePrivilege("UniversalXPConnect");
            }
            catch (e) {
                alert( "该操作被浏览器拒绝，如果想启用该功能，请在地址栏内输入 about:config,然后将项signed.applets.codebase_principal_support 值该为true" );
            }
        }
        var prefs = Components.classes['@mozilla.org/preferences-service;1'].getService(Components. interfaces.nsIPrefBranch);
        prefs.setCharPref('browser.startup.homepage',pageURL);
    }
}



function cswitch(tid,box,num,tag){
if(tid==null || box==null || num==null) return;
var tabs=document.getElementById(tid);
if(tabs==null) return;
if(tag=="") tag="LI";
tabs=tabs.getElementsByTagName(tag);
for(n=0;n<tabs.length;n++){
	 if(num==n){
		tabs[n].className="current";
		document.getElementById(box+n).className="sw";
	 }else{
		tabs[n].className="";
		document.getElementById(box+n).className="hd";
	 }	
}	
}


var flag=false; 

function DrawImage(ImgD,awidth,aheight){ 

var image=new Image(); 

image.src=ImgD.src; 

if(image.width>0 && image.height>0){ 

  flag=true; 

  if(image.width/image.height>= awidth/aheight){ 

   if(image.width>awidth){

    ImgD.width=awidth; 

    ImgD.height=(image.height*aheight)/image.width; 

   }else{ 

    ImgD.width=image.width;

    ImgD.height=image.height; 

   }

   /*ImgD.alt="bigpic"  */

  } 

  else{ 

   if(image.height>aheight){

    ImgD.height=aheight; 

    ImgD.width=(image.width*awidth)/image.height; 

   }else{ 

    ImgD.width=image.width;

    ImgD.height=image.height; 

   } 

    /*ImgD.alt="bigpic"  */ 

  } 

}

}






function makeup(r){
				var url=r;
				var img=document.getElementById("pushimg");
				img.src=url;
				img.jqimg=url;
				
				 var sections=document.getElementsByTagName("a");
				  for(var i=0;i<sections.length;i++){
					  var section=sections[i];
					   if(section.getAttribute("rel")=="lightbox"){
						    section.href=url;
					   }
				  }

				}




function MM_jumpMenu(targ,selObj,restore){ //v3.0
  eval(targ+".location='"+selObj.options[selObj.selectedIndex].value+"'");
  if (restore) selObj.selectedIndex=0;
}





function showme(id){
	var i=0;
if(id!=""){
	for(i=0;i<=1;i++){
		document.getElementById("p"+i).className='hd';
	}
	document.getElementById(id).className='sw';
}else{
		for(i=0;i<=1;i++){
		document.getElementById("p"+i).className='hd';
	}
}
}




function subsort(id){
sortact.action="search.php?select="+id;
//alert(sortact.action);
//product"+id+"-"+act+".html
//alert(obj);
sortact.submit();
}



function printPage() {
  if (window.print) {
	 if(navigator.userAgent.toLowerCase().indexOf('mozilla') != -1)
	 {
		if(navigator.userAgent.toLowerCase().indexOf('msie') !=-1)
		   {
		   // much better browser, so do nothing
		   }

		else
		   {
			if(parseInt(navigator.appVersion)>3 && parseInt(navigator.appVersion)<5)
			{
			  alert('you are using nav4 so print format not supported');
			}
		   }

	 }

	 window.print();
  } else {
	 alert("Sorry, your browser doesn't support this feature.");
  }
}




function getlicense()
{
  if (document.getElementById('viewlicense').checked==true)
  {
    document.getElementById('license').style.display='';
  }
  else
  {
   document.getElementById('license').style.display='none';
  }
}

function locahref(){
	 username = document.getElementById("cusername").value;
	 window.open("check.php?username="+username);
}
