var stmnGAP1 = 0;  //始终置顶时将值改为0
var stmnGAP2 = 0;  //翻屏时保持置顶将值改为0
var stmnBASE = 200; 
var stmnActivateSpeed = 200;
var stmnScrollSpeed = 10; 
var stmnTimer; 


function RefreshStaticMenu() 
{ 
var stmnStartPoint, stmnEndPoint, stmnRefreshTimer; 
stmnStartPoint = parseInt(Layer1.style.top, 10); 
stmnEndPoint = document.body.scrollTop + stmnGAP2; 
if (stmnEndPoint < stmnGAP1) stmnEndPoint = stmnGAP1; 
stmnRefreshTimer = stmnActivateSpeed; 
if ( stmnStartPoint != stmnEndPoint ) { 
stmnScrollAmount = Math.ceil( Math.abs( stmnEndPoint - stmnStartPoint ) / 15 ); 
Layer1.style.top = parseInt(Layer1.style.top, 10) + ( ( stmnEndPoint<stmnStartPoint ) ? -stmnScrollAmount : stmnScrollAmount ); 
stmnRefreshTimer = stmnScrollSpeed; 
} 
stmnTimer = setTimeout ("RefreshStaticMenu();", stmnRefreshTimer); 
} 

function ToggleAnimate() 
{ 
if (ANIMATE.checked) { 
RefreshStaticMenu(); 
SaveCookie("ANIMATE", "true", 300); 
} 
else { 
clearTimeout(stmnTimer); 
Layer1.style.top = stmnGAP1; 
SaveCookie("ANIMATE", "false", 300); 
} 
} 

function InitializeStaticMenu() 
{ 
Layer1.style.top = document.body.scrollTop + stmnBASE;   
RefreshStaticMenu(); 
} 


function InitYuekan() 
{ 
Layer2.style.top = document.body.scrollTop + stmnBASE; 
RefreshYueKan(); 
} 

function RefreshYueKan() 
{ 
var stmnStartPoint, stmnEndPoint, stmnRefreshTimer; 
stmnStartPoint = parseInt(Layer2.style.top, 10); 
stmnEndPoint = document.body.scrollTop + stmnGAP2; 
if (stmnEndPoint < stmnGAP1) stmnEndPoint = stmnGAP1; 
stmnRefreshTimer = stmnActivateSpeed; 
if ( stmnStartPoint != stmnEndPoint ) { 
stmnScrollAmount = Math.ceil( Math.abs( stmnEndPoint - stmnStartPoint ) / 15 ); 
Layer2.style.top = parseInt(Layer2.style.top, 10) + ( ( stmnEndPoint<stmnStartPoint ) ? -stmnScrollAmount : stmnScrollAmount ); 
stmnRefreshTimer = stmnScrollSpeed; 
} 
stmnTimer = setTimeout ("RefreshYueKan();", stmnRefreshTimer); 
} 

function openUpfile(getVarName , getVarVal){
	window.open('/SkyJpwAdmin/upfileFunc/upfile.php?'+getVarName+'='+getVarVal, null, 'height=200,width=300');
}



//-------------------图片缩放--------
//Image zoom in/out script- by javascriptkit.com
//Visit JavaScript Kit (http://www.javascriptkit.com) for script
//Credit must stay intact for use
var zoomfactor=0.05 //Enter factor (0.05=5%)
function zoomhelper(){
	if (parseInt(whatcache.style.width)>10&&parseInt(whatcache.style.height)>10){
		whatcache.style.width=parseInt(whatcache.style.width)+parseInt(whatcache.style.width)*zoomfactor*prefix
		whatcache.style.height=parseInt(whatcache.style.height)+parseInt(whatcache.style.height)*zoomfactor*prefix
	}
}

function zoom(originalW, originalH, what, state){
	if (!document.all&&!document.getElementById)
	return

	whatcache=eval("document.images."+what)
	prefix=(state=="in")? 1 : -1

	if (whatcache.style.width==""||state=="restore"){
		whatcache.style.width=originalW
		whatcache.style.height=originalH
		if (state=="restore")
		return
	}
	else{
		zoomhelper()
	}
	beginzoom=setInterval("zoomhelper()",100)
}

function clearzoom(){
	if (window.beginzoom)
	clearInterval(beginzoom)
}
//--------------图片缩放----------------
