﻿
//var vouchMovie = [ '空房诱奸', '变形金刚2 ', '诱惑性游戏3', '性喜剧', '越狱第四季第六集' ];   

var vouchMovieIndex = 0;
var intervalInGG = 0;
function filekwInGG() {
    $('.ggsearchInput').css('color', '#aaaaaa');
    $('.ggsearchInput').val(vouchMovie[vouchMovieIndex]);
    vouchMovieIndex++;
    if(vouchMovieIndex == vouchMovie.length) vouchMovieIndex = 0; 
}
 
function showTab(clas,el){
	$(".urlList .coolSite .current").removeClass("current");
	$(el).parent().addClass("current");
	$(".subItm:visible").hide();
	$("."+clas).show();
}
function showMovieTab(idx,el){
	$(".HotMovie .MovieMenu .current").removeClass("current");
	$(el).parent().addClass("current");
	$(".HotMovie .MovieList:visible").hide();
	$("#MovieList_"+idx).show();
}

function trim(str){
	return str.replace(/(^\s*)|(\s*$)/g, "");
}
function clickMail()
{var gm=document.gomail
var vDomain=gm.domains
var vName=gm.uName
var vPw=gm.uPw
if(vDomain.value==""){alert("您没有选择邮箱！")
	vDomain.focus()
	return false}
if(vName.value==""){alert("用户名不能为空！")
	vName.focus()
	return false
}
if(vPw.value==""){alert("密码不能为空！")
	vPw.focus()
	return false}
switch(vDomain.value){
case "163":
gm.action="http://reg.163.com/CheckUser.jsp"
gm.url.value="http://fm163.163.com/coremail/fcg/ntesdoor2?lightweight=1&verifycookie=1&language=-1&style=15"
gm.username.value=vName.value
gm.password.value=vPw.value
gm.enterVip.value=''
break
case "126":
gm.action="http://entry.126.com/cgi/login"
gm.domain.value="126.com"
gm.user.value=vName.value
gm.pass.value=vPw.value
break
case "yeah":
gm.action="http://entry.yeah.net/cgi/login"
gm.domain.value="yeah.net"
gm.user.value=vName.value
gm.pass.value=vPw.value
break
case "188":
gm.action="http://reg.mail.188.com/servlet/coremail/login?language=0&style=1"
gm.user.value=vName.value
gm.pass.value=vPw.value
break
case "sohu":
gm.action="http://passport.sohu.com/login.jsp"
gm.url.value=""
gm.UserName.value=vName.value
gm.Password.value=vPw.value
gm.id.value=vName.value
gm.username.value=vName.value
gm.password.value=vPw.value
gm.m.value=vName.value
gm.passwd.value=vPw.value
gm.mpass.value=vPw.value
gm.loginid.value=vName.value+"@sohu.com"
gm.fl.value="1"
gm.vr.value="1|1"
gm.appid.value="1000"
gm.ru.value="http://login.mail.sohu.com/servlet/LoginServlet"
gm.eru.value="http://login.mail.sohu.com/login.jsp"
gm.ct.value="1173080990"
gm.sg.value="5082635c77272088ae7241ccdf7cf062"
break
case "yahoo":
gm.action="http://edit.bjs.yahoo.com/config/login"
gm.login.value=vName.value
gm.passwd.value=vPw.value
break
case "yahoocn":
gm.action="http://edit.bjs.yahoo.com/config/login"
gm.login.value=vName.value+"@yahoo.cn"
gm.passwd.value=vPw.value
break
case "tom":
gm.action="http://bjweb.163.net/cgi/163/login_pro.cgi"
gm.user.value=vName.value
gm.pass.value=vPw.value
break
case "21cn":
gm.action="http://passport.21cn.com/maillogin.jsp"
gm.LoginName.value=vName.value
gm.passwd.value=vPw.value
gm.domainname.value="21cn.com"
gm.UserName.value=vName.value+'@21cn.com'
break
case "sina":
gm.action="http://mail.sina.com.cn/cgi-bin/login.cgi"
gm.u.value=vName.value
gm.psw.value=vPw.value
break
case "gmail":
gm.action="https://www.google.com/accounts/ServiceLoginAuth"
gm.Email.value=vName.value
gm.Passwd.value=vPw.value
break
case "chinaren":
gm.action="http://passport.sohu.com/login.jsp"
gm.loginid.value=vName.value+"@chinaren.com"
gm.passwd.value=vPw.value
gm.fl.value="1"
gm.vr.value="1|1"
gm.appid.value="1005"
gm.ru.value="http://profile.chinaren.com/urs/setcookie.jsp?burl=http://alumni.chinaren.com/"
gm.ct.value="1174378209"
gm.sg.value="84ff7b2e1d8f3dc46c6d17bb83fe72bd"
break
case "tianya":
gm.action="http://www.tianya.cn/user/loginsubmit.asp"
gm.vwriter.value=vName.value
gm.vpassword.value=vPw.value
break
case "baidu":
gm.action="http://passport.baidu.com/?login"
gm.username.value=vName.value
gm.password.value=vPw.value
break
case "xiaonei":
gm.action="http://login.xiaonei.com/Login.do"
gm.email.value=vName.value
gm.password.value=vPw.value
break
case "51com":
gm.action="http://passport.51.com/login.5p"
gm.passport_51_user.value=vName.value
gm.passport_51_password.value=vPw.value
gm.gourl.value="http%3A%2F%2Fmy.51.com%2Fwebim%2Findex.php"
break
}
vPw.value=""
return true}

function xlsearch(idx,el){
	$(".tags .focu").removeClass("focu");
	$(el).addClass("focu");
	if(idx!=7 && $("#gougouSearch").is(":hidden")){
			$("#gougouSearch").show();
			$("#baiduSearch").hide();
		}
	if(idx!=8){
		$("#searchText").attr("name","search");
	}
	switch(idx){
		case 1:
			$("#search_form").attr("action","http://web.gougou.com/search");
			break;
		case 2:
			$("#search_form").attr("action","http://www.gougou.com/search");
			break;
		case 3:
			$("#search_form").attr("action","http://movie.gougou.com/search");
			break;
		case 4:
			$("#search_form").attr("action","http://mp3.gougou.com/search");
			break;
		case 5:
			$("#search_form").attr("action","http://game.gougou.com/search");
			break;
		case 6:
			$("#search_form").attr("action","http://soft.gougou.com/search");
			break;
		case 7:
			$("#gougouSearch").hide();
			$("#baiduSearch").show();
			break;
		case 8:
			$("#search_form").attr("action","http://video.gougou.com/search");
			$("#searchText").attr("name","s");
			break;
	}
}
 

 

var frmact = new Array();
var frmnm = new Array();
var frmid = new Array();
var frmimg = new Array();
var frmlink = new Array();
frmlink[0] = "http://news.baidu.com/";
frmlink[1] = "http://www.baidu.com/index.php?tn=yidaowang_pg&fyb=0";
frmlink[2] = "http://tieba.baidu.com/";
frmlink[3] = "http://zhidao.baidu.com/";
frmlink[4] = "http://mp3.baidu.com/";
frmlink[5] = "http://image.baidu.com/";
frmlink[6] = "http://video.baidu.com/";

frmimg[0] = "http://www.68408.com/images/logo_news.gif";
frmimg[1] = "http://www.68408.com/images/logox3.gif";
frmimg[2] = "http://www.68408.com/images/logo_post.gif";
frmimg[3] = "http://www.68408.com/images/logo_zhidao.gif";
frmimg[4] = "http://www.68408.com/images/logo_mp3.gif";
frmimg[5] = "http://www.68408.com/images/logo_pic.gif";
frmimg[6] = "http://www.68408.com/images/logo_video.gif";

frmact[0] = "http://news.baidu.com/ns";
frmact[1] = "http://www.baidu.com/baidu";
frmact[2] = "http://post.baidu.com/f";
frmact[3] = "http://zhidao.baidu.com/q";
frmact[4] = "http://mp3.baidu.com/m";
frmact[5] = "http://image.baidu.com/i";
frmact[6] = "http://video.baidu.com/v";

frmnm[0] = "新闻";
frmnm[1] = "网页";
frmnm[2] = "贴吧";
frmnm[3] = "知道";
frmnm[4] = "MP3";
frmnm[5] = "图片";
frmnm[6] = "视频";

frmid[0] = "1";
frmid[1] = "2";
frmid[2] = "3";
frmid[3] = "4";
frmid[4] = "5";
frmid[5] = "6";
frmid[6] = "7";
 
//new
function changetab(idx) 
{
	for (i=0;i<frmact.length;i++) {
		if (i==idx) {document.getElementById('sitem_'+i).className="chon";}
        else {document.getElementById('sitem_'+i).className="ch";} 
	}
//	$('.srchbox div').each(function(i,o){if(i==idx)$(o).css('display','block');else $(o).css('display','none');});
//	$o.removeClass('show');
//	$o.addClass('kwitem');
}

if (frmid[0] == "1") {var bd_idx=1;}else{var bd_idx=0;}

function bd_chg_idx(idx, obj)
{ 
    bd_idx = idx;
    $('.focu').removeClass('focu');
    $(obj).addClass('focu');
    $('#urllogo').attr('href', frmlink[idx]);
    $('#imglogo').attr('src', frmimg[idx]);

	$('.srchbox div').each(function(i, o) {
	    if(i == idx) {
	        $(o).css('display' , 'block');
	    } else {
	        $(o).css('display' , 'none');
	    }
	});

    changetab(idx);
}


function addhiddenEle(parentEle, childEleName, childEleValue)
{
	for (var i=0; i < childEleName.length; i++) {
		 var ur = document.createElement("input");   
		  ur.type = "hidden";   
		  ur.name = childEleName[i];   
		  ur.value = childEleValue[i]; 
		  parentEle.appendChild(ur); 
	}
}

function removeallhiddenEle(parentEle)
{
	 for (var i = parentEle.length - 1; i >= 0; i--) {
    var childEle = parentEle.elements[i];
		if(childEle.type == "hidden"){
			childEle.parentNode.removeChild(childEle);
		}
	}
}
 

function gowhere(formname)
{
 var url;
 var idx = bd_idx; 
 if (frmact[idx] == null || frmact[idx] == "")  idx = "1";
 url = frmact[idx];

 removeallhiddenEle(formname); 
 switch(frmid[idx]){
	case "1":
		var childEleName = new Array();
		var childEleValue = new Array();

		childEleName[0] = "cl";
		childEleValue[0] = "2";

		childEleName[1] = "ct";
		childEleValue[1] = "0";

		childEleName[2] = "rn";
		childEleValue[2] = "20";

		addhiddenEle(formname, childEleName, childEleValue);

		formname.word.name = "word";

		break;

	case "2":
		var childEleName = new Array();
		var childEleValue = new Array();

		childEleName[0] = "tn";
		childEleValue[0] = "yidaowang_pg";		

		childEleName[1] = "fyb";
		childEleValue[1] = "0";

		addhiddenEle(formname, childEleName, childEleValue);

		formname.word.name = "word";

		break;

	case "3":
		
		formname.word.name = "kw";

		break;

	case "4":
	
		var childEleName = new Array();
		var childEleValue = new Array();

		childEleName[0] = "ct";
		childEleValue[0] = "17";

		childEleName[1] = "pn";
		childEleValue[1] = "0";

		childEleName[2] = "rn";
		childEleValue[2] = "10";

		childEleName[3] = "tn";
		childEleValue[3] = "ikaslist";

		addhiddenEle(formname, childEleName, childEleValue);

		formname.word.name = "word";

		break;

	case "5":
		var childEleName = new Array();
		var childEleValue = new Array();

		childEleName[0] = "ct";
		childEleValue[0] = "134217728";

		childEleName[1] = "lm";
		childEleValue[1] = "-1";

		addhiddenEle(formname, childEleName, childEleValue);

		formname.word.name = "word";

		break;

	case "6":
		var childEleName = new Array();
		var childEleValue = new Array();

		childEleName[0] = "ct";
		childEleValue[0] = "201326592";

		childEleName[1] = "lm";
		childEleValue[1] = "-1";

		childEleName[2] = "cl";
		childEleValue[2] = "2";

		addhiddenEle(formname, childEleName, childEleValue);

		formname.word.name = "word";

		break; 
	case "7":
		var childEleName = new Array();
		var childEleValue = new Array(); 

		childEleName[0] = "ct";
		childEleValue[0] = "201326592";

		childEleName[1] = "pn";
		childEleValue[1] = "0";

		childEleName[2] = "rn";
		childEleValue[2] = "20";

		childEleName[3] = "db";
		childEleValue[3] = "0";

		childEleName[4] = "s";
		childEleValue[4] = "0";


		addhiddenEle(formname, childEleName, childEleValue);

		formname.word.name = "word";

		break; 
	case "99":

		var childEleName = new Array();
		var childEleValue = new Array();
		
		childEleName[0] = "tn";
		childEleValue[0] = "bds";

		childEleName[1] = "cl";
		childEleValue[1] = "3";

		childEleName[2] = "ct";
		childEleValue[2] = "2097152";

		childEleName[3] = "si";
		childEleValue[3] = "baidu.com";


		addhiddenEle(formname, childEleName, childEleValue);

		formname.word.name = "word";

		break;

	default:
		return false;
 }

 formname.action = url;
 return true;
} 

function addfavorite()
{
   if (document.all)
   {
      window.external.addFavorite("http://www.68408.com","68408网址导航");
   }
   else if (window.sidebar)
   {
      window.sidebar.addPanel("68408网址导航","http://www.68408.com","");
   }
} 

$(document).ready(function(){
    $('a[webid]').click(function(){
        var webid = $(this).attr('webid');
        if(webid.length > 0) {
            //添加到浏览记录
            var item = new webView();
            item.u = $(this).attr('href');
            item.l = $(this).html();
            item.w = webid;
            showWebView(setWebView(filterWebView(item, getWebView())));      //读取,过滤,保存
            //TODO:点击统计      //要判断webid的值...当大于0时才可以进行点击统计...
                    if(webid>0)
                    {
                        var curlist=getWebView();
                        var add=true;
                        for(var i=0;i<curlist.length;i++)
                        {
                            if(curlist[i].w==webid)
                                {
                                    add=false;
                                    break;
                                }
                        }
                        if(add)
                        {
                            $.ajax({
                              url: "http://city.68408.com/clickcounter/?WebID="+webid,
                              async: true
                             });
                        }
                    }
        }
    });
    showWebView(getWebView());
    $('.dateTime').html(clock());
    
    try{MiniSite.Weather.print("Wealth");} catch(e){}
    var ran = Math.random();    
//    var index = parseInt(ran.toString().substring(2, 3)); 
//    if(index < vouchMovie.length) {
//        var ifram = document.createElement('iframe');
//        ifram.id = 'abc'; 
//        ifram.style.width = 1;
//        ifram.style.height = 0; 
//        document.body.appendChild(ifram); 
//        document.getElementById('abc').src = 'http://movie.gougou.com/search?search=' + vouchMovie[index] + '&id=46286&pattern=10300'; 
//    }  
    
    //getWidthHeidth();
}); 



function getWidthHeidth()   
{   
    var WidthHeidth="";   
    WidthHeidth+="IE:window.screenLeft:\t"+window.screenLeft;   
    WidthHeidth+="\nIE:window.screenTop:\t"+window.screenTop;   
    WidthHeidth+="\nFF:window.screenX:\t"+window.screenX;   
    WidthHeidth+="\nFF:window.screenY:\t"+window.screenY;   
       
    WidthHeidth+="\nIE & FF:window.document.body.offsetWidth:\t"+window.document.body.offsetWidth;   
    WidthHeidth+="\nIE & FF:window.document.body.offsetHeight:\t"+window.document.body.offsetHeight;   
       
    WidthHeidth+="\nIE & FF:window.document.documentElement.clientWidth:\t"+window.document.documentElement.clientWidth;   
    WidthHeidth+="\nIE & FF:window.document.documentElement.clientHeight:\t"+window.document.documentElement.clientHeight;   
       
    WidthHeidth+="\nFF:window.innerWidth:\t"+window.innerWidth;   
    WidthHeidth+="\nFF:window.innerHeight:\t"+window.innerHeight;   
    WidthHeidth+="\nFF:window.outerWidth:\t"+window.outerWidth;   
    WidthHeidth+="\nFF:window.outerHeight:\t"+window.outerHeight;   
       
    WidthHeidth+="\nIE & FF:window.screen.width:\t"+window.screen.width;//分辨率   
    WidthHeidth+="\nIE & FF:window.screen.height:\t"+window.screen.height;//分辨率   
    WidthHeidth+="\nIE & FF:window.screen.availWidth:\t"+window.screen.availWidth;   
    WidthHeidth+="\nIE & FF:window.screen.availHeight:\t"+window.screen.availHeight;   
       
    WidthHeidth += "\ndocument.documentElement.clientWidth + document.documentElement.scrollLeft:" + document.documentElement.clientWidth + document.documentElement.scrollLeft;
       
    alert(WidthHeidth);   
}

