﻿    var bb = ["ie90", "bing", "baidu", "yahoo", "sogou", "gougou","soso","yodao","google"];
    var cc = ["tablink1","tablink2","tablink3","tablink4","tablink5","tablink6","tablink7","tablink8","tablink9"]
      var sc = "ie90";

     function search(obj) {
      
    }

    function OpenWindows() {
        var inputText=document.getElementsByName("serch")
        var kw="";
        for(var i=0;i<inputText.length;i++)
        {
           if(inputText[i].value!="" && inputText[i].value!=null)
           {
              kw =inputText[i].value; 
           }
        }
        if (sc.length == 0 || kw.length == 0) {
            return;
        }
        
        window.location.href="search/Default.aspx?kw=" + encodeURIComponent(kw) + "&sc=" + sc;

    }

    function mainLoop() {

        var val ="";
        var inputText=document.getElementsByName("serch")
        for(var i=0;i<inputText.length;i++)
        {
           if(inputText[i].value!="" && inputText[i].value!=null)
           {
              val =inputText[i].value; 
           }
        }
        if ((document.getElementById("ie90").getAttribute("src").indexOf("ie90_2.gif")>0) && (val.length != 0) && (lastVal != val)) {
           $.post("Ajax.aspx", 
                { Action: "post",Name: val},
		        function (data, textStatus){
			        var list = eval(data);
			        showQueryDiv(list);
			        lastVal = val;
		        }, "json");
           
        }
    }
		



function addLoadEvent(func) {
    var oldonload = window.onload;
    if (typeof window.onload != 'function') {
        window.onload = func;
    } else {
        window.onload = function() {
            oldonload();
            func();
        }
    }
}



var list = new Array();
function initXml() {
    var xmldoc = new ActiveXObject("Microsoft.XMLDOM");
    xmldoc.async = false;

    xmldoc.load("2.xml");
    var s = xmldoc.parseError.errorCode;
    if (xmldoc.readyState == 4 && xmldoc.parseError.errorCode == 0) {
        var nodes = xmldoc.documentElement.selectNodes("item");
        if (nodes != null && nodes.length > 0) {
            var content = "";
            var item = null;
            for (var i = 0; i < nodes.length; i++) {
                item = new Object();
                item.id = nodes(i).childNodes(0).text;
                item.url = nodes(i).childNodes(1).text;
                item.title = nodes(i).childNodes(2).text;
                list.push(item);
            }
        }
    }

    window.setTimeout(f1, 2000);
    window.setTimeout(f2, 2000);
    window.setTimeout(f3, 2000);
    window.setTimeout(f4, 2000);
    window.setTimeout(f5, 2000);
}

function f1() {
    var s = document.getElementById("sid1");
    var index = Math.floor(Math.random() * list.length);

    if (list[index].id == 1) {
        s.href = list[index].url;

        if (list[index].url == "http://www.ie90.cn/") {
            s.innerHTML = "<span style='color:Red'>" + list[index].title + "</span>";
        } else {
            s.innerText = list[index].title;
        }
    }
    window.setTimeout(f1, 500);
}
function f2() {
    var s = document.getElementById("sid2");
    var index = Math.floor(Math.random() * list.length);
    if (list[index].id == 2) {
        s.href = list[index].url;

        if (list[index].url == "http://www.ie100.cn/") {
            s.innerHTML = "<span style='color:Red'>" + list[index].title + "</span>";
        } else {
            s.innerText = list[index].title;
        }
    }
    window.setTimeout(f2, 500);
}
function f3() {
    var s = document.getElementById("sid3");
    var index = Math.floor(Math.random() * list.length);
    if (list[index].id == 3) {
        s.href = list[index].url;
        if (list[index].url == "http://www.tcc360.cn") {
            s.innerHTML = "<span style='color:Red'>" + list[index].title + "</span>";
        } else {
            s.innerText = list[index].title;
        }
    }
    window.setTimeout(f3, 500);
}
function f4() {
    var s = document.getElementById("sid4");
    var index = Math.floor(Math.random() * list.length);
    if (list[index].id == 4) {
        s.href = list[index].url;
        s.innerText = list[index].title;
    }
    window.setTimeout(f4, 500);
}
function f5() {
    var s = document.getElementById("sid5");
    var index = Math.floor(Math.random() * list.length);
    if (list[index].id == 5) {
        s.href = list[index].url;
        s.innerText = list[index].title;
    }
    window.setTimeout(f5, 500);
}
    
    
    
    
    //---------------jq 弹出框--------------------//

$(document).ready(function() {
	$("#test1").click(function(){
		$.tipsWindow({});
	});
	$("#test1_1").click(function(){
		$.tipsWindow({
			___title:"左上角",
			___drag:"___boxTitle",
			___offsets:{left:0,top:0}
		});
	});
	$("#test1_2").click(function(){
		$.tipsWindow({
			___title:"右上角",
			___drag:"___boxTitle",
			___offsets:{left:0,top:0},
			___fns:function(){
				var $box = $("#___box");
				var sw = $box.outerWidth(),
					cw = document.documentElement.clientWidth;
				var $left = cw-sw;
				$("#___box").css({
					left:$left
				});
			}
		});
	});
	$("#test1_3").click(function(){
		$.tipsWindow({
			___title:"左下角",
			___drag:"___boxTitle",
			___offsets:{left:0,top:0},
			___fns:function(){
				var $box = $("#___box");
				var sh = $box.outerHeight(),
					ch = document.documentElement.clientHeight;
				var $top = ch-sh;
				$("#___box").css({
					left:0,top:$top
				});
			}
		});
	});
	$("#test1_4").click(function(){
		$.tipsWindow({
			___title:"右下角",
			___drag:"___boxTitle",
			___offsets:{left:0,top:0},
			___fns:function(){
				var $box = $("#___box");
				var sw = $box.outerWidth(),sh = $box.outerHeight(),
					cw = document.documentElement.clientWidth,ch = document.documentElement.clientHeight;
				var $left = cw-sw;
				var $top = ch-sh;
				$("#___box").css({
					left:$left,top:$top
				});
			}
		});
	});
	$("#test1_5").click(function(){
		$.tipsWindow({
			___title:"自定义位置",
			___drag:"___boxTitle",
			___offsets:{left:100,top:100}
				
		});
	});
	$("#test1_6").click(function(){
		$.tipsWindow({
			___title:"吸附模式",
			___drag:"___boxTitle",
			___triggerID:"test1_6",
			___offsets:{left:80,top:0}
		});
	});
	$("#test1_7").click(function(){
	  
	   
		    $.tipsWindow({
			    ___title:"请输入访问密码",
		        ___drag:"___boxTitle",
			    ___boxBdColor:"#000",
			    ___boxBdOpacity:"0.2",
			    ___boxWrapBdColor:"#ABABAB",
			    ___content: "iframe:login.html?username="+$("#username").val()
		    });
	    
		
	});
	
	$("#test1_110").click(function(){
	      
	   
		    $.tipsWindow({
			    ___title:"查询结果",
		        ___drag:"___boxTitle",
			    ___boxBdColor:"#000",
			    ___boxBdOpacity:"0.2",
			    ___boxWrapBdColor:"#ABABAB",
				___width: "450",					//窗口宽度
			    ___height: "390",		
			    ___content: "iframe:xy_list.html?page=1&username="+$("#serch2").val()
		    });
		
	});

	$("#test2").click(function(){
		$.tipsWindow({
			___title:"Hello world",
			___content:"text:提示信息内容",
			___width:"300",
			___height:"200",
			___drag:"___boxTitle",
			___showbg:true
		});
	});
	$("#test3").click(function(){
		$.tipsWindow({
			___title:"我是页面中的一个ID",
			___content:"id:testID",
			___width:"300",
			___height:"200",
			___drag:"___boxTitle",
			___closeID:"c2",
			___showbg:true,
			___fns:function(){
				alert("Hello!")
			}
		})
		
	});
	$("#test4").click(function(){
		$.tipsWindow({
			___title:"我是一张图片",
			___content:"img:http://leotheme.cn/wp-content/uploads/2008/09/tr2xcp6yw4o5xebj9s.jpg",
			___width:"500",
			___height:"230",
			___drag:"___boxTitle",
			___showbg:true
		});
	});
	$("#test5").click(function(){
		$.tipsWindow({
			___title:"我是测试文件",
			___content:"url:get?test.html",
			___width:"400",
			___height:"200",
			___drag:"___boxTitle",
			___showbg:true
		});
	});
	$("#test6").click(function(){
		$.tipsWindow({
			___title:"框架应用",
			___content:"iframe:http://www.baidu.com",
			___width:"800",
			___height:"420",
			___drag:"___boxTitle",
			___showbg:true
		});
	});
	$("#test7").click(function(){
		$.tipsWindow({
			___title:"自动关闭",
			___content:"text:3秒后我会自动关闭",
			___width:"300",
			___height:"200",
			___drag:"___boxTitle",
			___time:"3000",
			___showbg:true
		});
	});
	$("#KType").change(function(){
	 aa();
	 })//#KType
 })
 function aa() {
	var _options = document.getElementById('KType').options;
	for(var i = 0 ; i < _options.length;i++){
		if(_options[i].selected){
			alert(_options[i].value);
			alert(_options[i].text);
		}
	}
}

 
 function getCookieVal(offset) {
 var endstr = document.cookie.indexOf(";", offset);
 if(endstr == -1) {
  endstr = document.cookie.length;
 }
 return document.cookie.substring(offset, endstr);
}
 
 function getCookie(name) {
 var arg = name + "=";
 var alen = arg.length;
 var clen = document.cookie.length;
 var i = 0;
 var j = 0;
 while(i < clen) {
  j = i + alen;
  if(document.cookie.substring(i, j) == arg){
   return getCookieVal(j);
  }
  i = document.cookie.indexOf(" ", i) + 1;
  if(i === 0){
   break;
  }
 }
 return '';
}








/*
EASY TABS 1.2 Produced and Copyright by Koller Juergen
www.kollermedia.at | www.austria-media.at
Need Help? http:/www.kollermedia.at/archive/2007/07/10/easy-tabs-12-now-with-autochange
You can use this Script for private and commercial Projects, but just leave the two credit lines, thank you.
*/

//EASY TABS 1.2 - MENU SETTINGS
//Set the id names of your tablinks (without a number at the end)
var tablink_idname = new Array("tablink","tablink")
//Set the id names of your tabcontentareas (without a number at the end)
var tabcontent_idname = new Array("tabcontent","anothercontent") 
//Set the number of your tabs in each menu
var tabcount = new Array("9","9")
//Set the Tabs wich should load at start (In this Example:Menu 1 -> Tab 2 visible on load, Menu 2 -> Tab 5 visible on load)
var loadtabs = new Array("1","9")  
//Set the Number of the Menu which should autochange (if you dont't want to have a change menu set it to 0)
var autochangemenu = 2;
//the speed in seconds when the tabs should change
var changespeed = 3;
//should the autochange stop if the user hover over a tab from the autochangemenu? 0=no 1=yes
var stoponhover = 0;
//END MENU SETTINGS


/*Swich EasyTabs Functions - no need to edit something here*/
function easytabs(menunr, active,obj) {

  sc = obj.id;
        var temp=obj.id
        for(var i=0;i<cc.length;i++)
        {
            if(cc[i]==temp)
            {
               sc=bb[i];
            }
        }

var text="";
if (menunr == autochangemenu)
   {
	   currenttab=active;
   }
   if ((menunr == autochangemenu)&&(stoponhover==1)) 
   {
	   stop_autochange()
   } 
   else if ((menunr == autochangemenu)&&(stoponhover==0))  
   {
	   counter=0;
	} 
	menunr = menunr-1;
	for (i=1; i <= tabcount[menunr]; i++)
	{
		document.getElementById(tablink_idname[menunr]+i).className='tab'+i;
		document.getElementById(tabcontent_idname[menunr]+i).style.display = 'none';
		if($("#"+tabcontent_idname[menunr]+i+" input").val()!="")
		{
		   text=$("#"+tabcontent_idname[menunr]+i+" input").val();
		}
	}
	document.getElementById(tablink_idname[menunr]+active).className='tab'+active+' tabactive';
	document.getElementById(tabcontent_idname[menunr]+active).style.display = 'block';
	$("#"+tabcontent_idname[menunr]+active+" input").val(text)
}
var timer; 
counter=0; 
var totaltabs=tabcount[autochangemenu-1];
var currenttab=loadtabs[autochangemenu-1];
function start_autochange(){
	counter=counter+1;
	timer=setTimeout("start_autochange()",1000);
	if (counter == changespeed+1) 
	{
		currenttab++;
		if (currenttab>totaltabs) 
		{
			currenttab=1
		}
		easytabs(autochangemenu,currenttab);
		restart_autochange();
	}
}
function restart_autochange()
{
	clearTimeout(timer);
	counter=0;start_autochange();
}
function stop_autochange()
{clearTimeout(timer);counter=0;}

window.onload=function(){
var menucount=loadtabs.length; var a = 0; var b = 1; do {easytabs(b, loadtabs[a]);  a++; b++;}while (b<=menucount);
if (autochangemenu!=0){start_autochange();}
}


 function getImage(obj)
        {
            var dt = new Date();
            obj.src="ValidateCode.aspx?key="+dt.getSeconds();
        }



 
 
 
