
    function $(id){
	   return document.getElementById(id);
	 }
	 var blnDragging;
	document.onmouseup=function(){blnDragging=false;}

var vminLimit= 0; 
var vmaxLimit= 100; 
var volSlider=$("zoomstate");
volSlider.style.width="64px";

var playfjd;
var blnDragging=false;
var mPosX;
var evtSrcObj;
function readyDragV(){
 if(document.layers){return false;}
 var evt=getEvent();
 mPosX=evt.clientX;
 playfjd=volSlider.style.width;
 blnDragging=true;
 document.onmousemove=volTrackingV;
} 
    var startGameWidth = 25;
    var startGameHeight = 750;
function zoomObject(pos){
	if(_gamemode==1)
	{
        var newWidth = Math.ceil( pos*startGameWidth/100 );
        var newHeight = Math.ceil( pos*startGameHeight/100 );
		newWidth=Math.ceil(pos*startGameWidth/10 * _gamewidth)
		newHeight=Math.ceil(pos*startGameWidth/10 * _gameheight)
        $("flashobj").style.width= newWidth+"px";
		$("flashobj").style.height= newHeight+"px";
		$("swfobj").style.width= newWidth+"px";
		$("swfobj").style.height= newHeight+"px";
		$("playb").style.height= newHeight+"px";
		$("playb").style.width= newWidth+"px";
		var divW=700;
		if (newWidth>divW)
		{
		    $("p_top").style.width=(330+newWidth-divW)+"px";
			$("p_top1").style.width=(770+newWidth-divW)+"px";
			$("boddon").style.width=(770+newWidth-divW)+"px";
			$("boddon1").style.width=(20+newWidth-divW)+"px";
			$("main").style.width=(770+newWidth-divW)+"px";
			$("p_center").style.width=(750+newWidth-divW)+"px";
		}
		else
		{
		    $("p_top").style.width="330px";
			$("p_top1").style.width="770px";
			$("boddon").style.width="770px";
			$("boddon1").style.width="20px";
			$("main").style.width="770px";
			$("p_center").style.width="750px";
		}

	//	$("art_back").style.background="url(../imgs/atr_top.gif)";
		//$("flashobj").innerHTML=$("flashobj").innerHTML+"<br>width:"+newWidth+"px;"+"height:"+newHeight+"px;p_center="+$("flashobj").style.width+";"+playfjd;

    }
}
function volTrackingV(){
	if (blnDragging ){
        var evt=getEvent();
	mousepositionX=evt.clientX;
		var sliderLength= vmaxLimit;
		var mov =  parseInt(playfjd) + mousepositionX - mPosX;
		
				if(mov <= vminLimit){
			volSlider.style.width=vminLimit+"px";
			//alert(mov);
			zoomObject(10);
 			
		}
		if(mov > vmaxLimit){
			volSlider.style.width=vmaxLimit+"px";
			//alert(mov);
			zoomObject(100);
		}
		if ((mov <= vmaxLimit) &&  (mov > vminLimit )){
			volSlider.style.width=parseInt(playfjd) + mousepositionX - mPosX+"px";
			//alert(mov);
			zoomObject(mov);
		}
	}return false;
}
function overDrag()
{
	blnDragging=false;
	return false;
}
document.write("<script language='JavaScript' src='/stat/?GameId="+_gameid+"'></script>");
var xmlDOM;
var sxmlhttp = new ActiveXObject("Microsoft.XMLHTTP");
function like(action)
{
    if(action=="")
	{
		$("rating").innerHTML="Oops! An error.. try again later!";
		return false;
	}
 	
	 var url="/rt/?GameId=" + _gameid +"&action="+action+"&timeStamp="+new Date().getTime();

	sxmlhttp.open("GET",url,true);
	sxmlhttp.setRequestHeader("Content-Type","application/x-www-form-urlencoded");
	sxmlhttp.onreadystatechange=manges;
	sxmlhttp.send();
}
function manges(){
	if(sxmlhttp.readyState==4){
	var infos=sxmlhttp.getResponseHeader("info");
	if(infos=="thanks"){
		$("rating").innerHTML="Thanks for your rating!";
	}else if(infos==""){
		$("rating").innerHTML="You've already rated this game!";
	}
	else{
		$("rating").innerHTML="Oops! An error.. try again later!";
	}

	}
}

function zoom_out(){
	var mov =  parseInt(volSlider.style.width) - 10;
	if (mov<10) { mov=10;}
	volSlider.style.width = mov+"px";
	zoomObject(mov);
	
}

function zoom_in(){
	var mov =  parseInt(volSlider.style.width) + 10;
	if (mov > 100){  mov=100;}
	volSlider.style.width= mov+"px" ;
	zoomObject(mov);
}
function CreateBookmarkLink(url,title){
	if(window.sidebar&&!document.all){window.sidebar.addPanel(title,url,"");}
	else
	if(window.external){window.external.AddFavorite(url,title);}
	else
	if(window.opera&&window.print){return false;}
}
function getEvent(){ //同时兼容ie和ff的写法 
   if(document.all) return window.event; 
   func=getEvent.caller; 
   while(func!=null){ 
   var arg0=func.arguments[0]; 
   if(arg0){ 
       if((arg0.constructor==Event || arg0.constructor ==MouseEvent) || (typeof(arg0)=="object" && arg0.preventDefault && arg0.stopPropagation)){ 
          return arg0; 
       } 
   } 
   func=func.caller; 
  } 
  return null; 
}