function GetCookie (name) { 
var arg = name + "="; 
var alen = arg.length; 
var clen = document.cookie.length; 
var i = 0; 
while (i < clen) { 
var j = i + alen; 
if (document.cookie.substring(i, j) == arg) 
return getCookieVal (j); 
i = document.cookie.indexOf(" ", i) + 1; 
if (i == 0) break; 
} 
return null;
}

function SetCookie (name, value) { 
var argv = SetCookie.arguments; 
var argc = SetCookie.arguments.length; 
var expires = (argc > 2) ? argv[2] : null; 
var path = (argc > 3) ? argv[3] : null; 
var domain = (argc > 4) ? argv[4] : null; 
var secure = (argc > 5) ? argv[5] : false; 
document.cookie = name + "=" + escape (value) + 
((expires == null) ? "" : ("; expires=" + expires.toGMTString())) + 
((path == null) ? "" : ("; path=" + path)) + 
((domain == null) ? "" : ("; domain=" + domain)) + 
((secure == true) ? "; secure" : "");
}

function DeleteCookie (name) { 
var exp = new Date(); 
exp.setTime (exp.getTime() - 1); 
// This cookie is history 
var cval = 0; 
document.cookie = name + "=" + cval + "; expires=" + exp.toGMTString();
}


//设置cookies时间,自己根据情况设置。
var expDays = 1;
var exp = new Date(); 
exp.setTime(exp.getTime() + (expDays*24*60*60*1000));


function amt(){
var count = GetCookie('count')
if(count == null) {
SetCookie('count','1')
//DeleteCookie('count')
//alert(count)
return 1
}
else{
var newcount = parseInt(count) + 1;
if(newcount<3) count=1;
SetCookie('count',newcount,exp);
//DeleteCookie('count')
//alert(count)
return count
}
}

function getCookieVal(offset) {
var endstr = document.cookie.indexOf (";", offset);
if (endstr == -1)
endstr = document.cookie.length;
return unescape(document.cookie.substring(offset, endstr));
}


var imgheight
var imgleft
window.screen.width>800 ? imgheight=110:imgheight=110
window.screen.width>800 ? imgleft=245:imgleft=350
function cgdiveload()
{
Layersds.style.top=document.body.scrollTop+document.body.offsetHeight-imgheight;
Layersds.style.left=imgleft;
streamlayer.style.top=0;
streamlayer.style.left=imgleft;
cgdivemove();
}
function cgdivemove()
 {
 Layersds.style.top=document.body.scrollTop+document.body.offsetHeight-imgheight;
 Layersds.style.left=imgleft;
 setTimeout("cgdivemove();",50)
 }

function MM_reloadPage(init) {  //reloads the window if Nav4 resized
  if (init==true) with (navigator) {if ((appName=="Netscape")&&(parseInt(appVersion)==4)) {
    document.MM_pgW=innerWidth; document.MM_pgH=innerHeight; onresize=MM_reloadPage; }}
  else if (innerWidth!=document.MM_pgW || innerHeight!=document.MM_pgH) location.reload();
}
//MM_reloadPage(true)

function MM_showHideLayers() { //v6.0
//document.getElementById('Layersds').style.display='none';
//document.getElementById('streamlayer').style.display='none';
}

function openwin()
{
	
document.write("<div id=Layersds style='position: absolute;width:150;top:350;visibility: hidden;z-index:1'>"
+"</div>"
+"<div id=streamlayer style='position: absolute;visibility: hidden;z-index: 1'><EMBED loop=false src='http://www.87050.com/asp/uploadfile/1101801.swf' quality=high  WIDTH=550 HEIGHT=400 TYPE='application/x-shockwave-flash' id=cgdivebig wmode=transparent></EMBED></div>");
cgdiveload()

	if(amt()==1) 
	{
		SYstream=true
		show_liumeiti();
	}else 
	{
		close_liumeiti();
	}

}

function show_liumeiti()
{
	Layersds.style.visibility='hidden';
	streamlayer.style.visibility='visible';
	//streamlayer.style.z-index=100;
}
function close_liumeiti()
{
	Layersds.style.visibility='visible';
	streamlayer.style.visibility='hidden';
	//Layersds.style.display='none';
	//streamlayer.style.display='none';
}

openwin()
