var bdy = (document.documentElement && document.documentElement.clientWidth)?document.documentElement:document.body;
var T = 400; 
var N = 400; //¸ß¶È
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();
}

var dToday = new Date();
var exp = new Date(dToday.getYear(),dToday.getMonth(),dToday.getDate(), 23 , 59 , 59 );


function amt(count,count_str){
var count = GetCookie(count_str)
if(count == null) {
SetCookie(count_str,'1')
DeleteCookie(count_str)
//alert(count)
return 1
}
else{
var newcount = parseInt(count) + 1;
if(newcount<3) count=1;
SetCookie(count_str,newcount,exp);
DeleteCookie(count_str)
//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 MSIE=navigator.userAgent.indexOf("MSIE");
var OPER=navigator.userAgent.indexOf("Opera");
var ifshowbig=false;
var ifclickclose=false;
var ifshowlogo=false;

function myLeftLoad()
{
if(bdy.scrollTop>180 && !ifshowbig && !ifclickclose){
document.getElementById('cl_style').style.visibility='visible';
document.getElementById('cl_styleshou').style.visibility='hidden';
ifshowlogo=false;
}else if(!ifshowlogo && !ifshowbig){
document.getElementById('cl_style').style.visibility='hidden';
document.getElementById('cl_styleshou').style.visibility='visible';
}
document.getElementById('cl_style').style.top=bdy.scrollTop+bdy.offsetHeight-350;
document.getElementById('cl_style').style.right=28;
//document.getElementById('cl_styleshou').style.top=bdy.scrollTop+bdy.offsetHeight-150;
//document.getElementById('cl_styleshou').style.right=0;
document.getElementById('cl_stylebig').style.top=bdy.scrollTop + float_stream_top +1;
document.getElementById('cl_stylebig').style.left = float_stream_left>=0?float_stream_left:(bdy.offsetWidth - float_stream_width)/2-10;
setTimeout("myLeftLoad();",50)
//leftmove();
}
function clickclose()
{
ifclickclose=true;
closeclshou();
}

function closeclshou()
{
document.getElementById('cl_style').style.display='none';
//adgun()
}

function showcl(){
	ifshowbig=true;
	document.getElementById('cl_stylebig').style.visibility='visible';
	document.getElementById("cl_stylebig").style.height = "420px"; 
	T = 400; 
	N = 400;
	document.getElementById('cl_style').style.visibility='hidden';
	document.getElementById('float_liumeiti').Play();
}
function showlogo(){
	ifshowlogo=true;
	document.getElementById('cl_style').style.visibility='visible';
	document.getElementById('cl_styleshou').style.visibility='hidden';
	closeclshou();
}
function closeliumeiti(){
	ifshowbig=false;
	document.getElementById('float_liumeiti').Rewind();
	document.getElementById('float_liumeiti').Stop();
	document.getElementById('cl_styleshou').style.visibility='hidden';
	document.getElementById('cl_stylebig').style.visibility='hidden';
	document.getElementById('cl_style').style.visibility='visible';
}
function openWin(){	
	document.getElementById('cl_style').style.visibility = 'hidden';
	document.getElementById('cl_styleshou').style.visibility = 'hidden';
	if(MSIE!=-1 && OPER==-1){
		myLeftLoad();
		var playCnt;  
		if(amt(playCnt,"cntOf" + document.URL)==1) 
		{
			document.getElementById('cl_style').style.visibility='hidden';
			document.getElementById('cl_styleshou').style.visibility='hidden';
			document.getElementById('cl_stylebig').style.visibility='visible';
			ifshowbig=true;
		}else closeclshou();
	}	
}

function closeclshou() 
{
   if(T>0) 
    { 
        T--; 
        N = N-10; 
    } 
    else 
    { 
        return; 
    } 
    if(N<0) 
    { 
		document.getElementById('cl_styleshou').style.visibility='visible';
		document.getElementById('cl_stylebig').style.visibility='hidden';
        return; 
    }
    document.getElementById("cl_stylebig").style.height = N+"px"; 
	//alert(document.getElementById("cl_stylebig").style.height);
    setTimeout("closeclshou()",30); 
} 

