var ua = navigator.userAgent.toLowerCase()
var isIE=ua.indexOf('msie') > -1
var isFF=ua.indexOf('firefox') > -1
//checkbrowser
var userAgent = navigator.userAgent.toLowerCase();
browser = {
version: (userAgent.match( /.+(?:rv|it|ra|ie)[\/: ]([\d.]+)/ ) || [0,'0'])[1],
safari: /webkit/.test( userAgent ),
opera: /opera/.test( userAgent ),
msie: /msie/.test( userAgent ) && !/opera/.test( userAgent ),
mozilla: /mozilla/.test( userAgent ) && !/(compatible|webkit)/.test( userAgent )
};
function SetCookie(name, value){
var expdate = new Date()
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
if(expires!=null) expdate.setTime(expdate.getTime() + ( expires * 1000 ))
document.cookie = name + "=" + escape (value) +((expires == null) ? "" : ("; expires="+ expdate.toGMTString()))
+((path == null) ? "" : ("; path=" + path)) +((domain == null) ? "" : ("; domain=" + domain))
+((secure == true) ? "; secure" : "")}
function top_domain(){
var domain,tmp=location.host.split('.'),i = tmp.length
var hz = tmp[(i-1)]
var hz2 = tmp[(i-2)]
if( hz2=='net' || hz2=='com' || hz2=='org'  ){return tmp[(i-3)]+"."+hz2+"."+hz}
return tmp[(i-2)]+"."+tmp[(i-1)]}
function GetCookie(n){
var aCookie = document.cookie.split("; ")
for(var i=0; i < aCookie.length; i++){
var aCrumb = aCookie[i].split("=")
if(n == aCrumb[0]){if(aCrumb[1])return unescape(aCrumb[1]);else return '';}
}return null}
function DelCookie(name){
var exp = new Date()
exp.setTime (exp.getTime() - 1)
var cval = GetCookie(name)
document.cookie = name + "=" + cval + "; expires="+ exp.toGMTString()}
var tagreg = new RegExp("</?[^>]+>","ig");
function his(n,l){
ll=sE.href.length;
if( location.href.substr(0,13) == sE.href.substr(0,13) ) return
if(n.substr(0,2)=='¸ü¶à') return
if(l.substr(0,4)!='http' ) return
n = n.replace(tagreg,'');
if(n.length>14)n=n.substr(0,14);
l = (l.replace(/</g,"&lt;")).replace(/>/g,"&gt;")
n = (n.replace(/</g,"&lt;")).replace(/>/g,"&gt;")
var hisstr=GetCookie('ckhis'),hisarr=new Array()
if( hisstr != null ) hisarr=hisstr.split('^^')
if(n=='' || l=='') return
var tmp = new Array(),row
if(typeof(hisarr) == 'object'){
if(hisarr.length > 14) delete(hisarr[0])
for(v in hisarr){row = hisarr[v].split('**');tmp[row[0]] = row[1]}
if( typeof(tmp[n]) != 'undefined' ) delete(tmp[n])
hisarr=new Array()
for(v in tmp)if( tmp[v] != 'undefined') hisarr.push(v+'**'+tmp[v])}
hisarr.push(n+'**'+l)
ck('ckhis',hisarr.join('^^'))
if($('nav2') && $('nav2').src=='lsjl.html')	frame('nav2').location.reload()
}
function ck(n,v){SetCookie(n,v,94608000,'/',top_domain())}
function frame(n){return (isFF)?document.getElementById(n).contentWindow:document.frames[n]}

function getPos(el){
var r = {'x':el.offsetLeft,'y':el.offsetTop}
if(el.offsetParent){
var tmp = getPos(el.offsetParent)
r.x += tmp.x;r.y += tmp.y
}return r}


function regE(n,e,f){if(window.attachEvent)	n.attachEvent(e,f);	else n.addEventListener(e.replace(/^on/,''),f,false)}
function $(obj){return document.getElementById(obj)}
function os(obj){return $(obj).style}

//email
mailshowed=false;
function showMail(e)
{
e = window.event || e
var sE = e.srcElement || e.target
if(sE.tagName=='SPAN' && sE.innerHTML !== "ÇëÑ¡ÔñÄúµÄÓÊÏä")
{
	return true;
}
mailshowed=true;
mailcomnum=0;
var b='none';
if(os('mailBody').display=='none')b='';
os('mailBody').display=b;
if(!mailifload){$('ifmail').src='mailxl.html';mailifload=1}
mailpagepos();
return false;
}

function loadUserMail()
{
	var mtitle = GetCookie( 'mailtitle');
	var mhref = GetCookie( 'mailhref');
	setUserMail(mtitle,mhref);
}
function setUserMail(mtitle,mhref)
{
	if(mtitle!=null && mtitle!='' && mtitle!='undefined' )
	{
		var mm = $('mailChoseA');
		mm.href = mhref;
		$('hmailTitle').innerText = mtitle;
		mm.target = "wzmail";
	}
}
//click mon
function click_mon(clickId,vurl)
{
php_click_go(clickId,vurl,location.href);
}

function click_mz(e)
{
	e = window.event || e
	sE = e.srcElement || e.target
	if( sE.tagName == "A" )
	{
		php_click_go('38',sE.href,location.href);
	}
}

function php_click_go(_clickId,_vpage,_vref)
{
	_vpage = escape(arguments[1]);
	_vref = escape(arguments[2]);
	_vsrc='http://click.7qiao.cn/c.php?id='+_clickId+'&size='+screen.width+','+screen.height+'&ref='+_vref+'&vpage='+_vpage;
	loadJs(_vsrc);
}
loadJs=function(file)
{
	var funExec=arguments[1];
	var funcLoading=arguments[2];
	var head_obj=document.getElementsByTagName('head')[0];
	var script=document.createElement('SCRIPT');
	script.setAttribute('type', 'text/javascript');
	script.setAttribute('src', file);
	head_obj.appendChild(script);
}




function bbgo(bbname)
{
	if(bbname=='jj')bbset('jj',1);
	currbb=bbname;
}

function bbset(bbname,a)
{	
	ck('skinbb',bbname);
	ck('skinp',a);
	if(bbname=='jj')
	{
		location.href="jj.html";
		return;
	}

}

