﻿SetCookie("PIN", "1ting.com");
function SetCookie(name, value)
{
	var expdate = new Date();
	var argv = SetCookie.arguments;
	var argc = SetCookie.arguments.length;
	var expires = '3600';
	var path = '/';
	var domain = '1ting.net';
	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 killErrors() {
return true;
}
window.onerror = killErrors;
 
// 自动 COPY 代码开始
function MM_findObj(n, d) { //v4.0
  var p,i,x;  if(!d) d=document; if((p=n.indexOf("?"))>0&&parent.frames.length) {
    d=parent.frames[n.substring(p+1)].document; n=n.substring(0,p);}
  if(!(x=d[n])&&d.all) x=d.all[n]; for (i=0;!x&&i<d.forms.length;i++) x=d.forms[i][n];
  for(i=0;!x&&d.layers&&i<d.layers.length;i++) x=MM_findObj(n,d.layers[i].document);
  if(!x && document.getElementById) x=document.getElementById(n); return x;
}
function JM_cc(ob){
	var obj=MM_findObj(ob); if (obj) { 
	obj.select();js=obj.createTextRange();js.execCommand("Copy");}
 }

// 自动 COPY 代码结束

 
function CopyInBoard(Url) 
{ 			
	window.clipboardData.setData('text',Url)
	alert('网址复制成功啦!');			
}
function Del(strUrl)
{
	
	var truthBeTold = window.confirm("确认删除！");
	if (truthBeTold) {
		window.location.href=strUrl;
	}else {}
}
 
 function getObject(idname) {
	if (document.getElementById){
		return document.getElementById(idname);
	}else if (document.all){
		return document.all[idname];
	}else if (document.layers){
		return document.layers[idname];
	}else{
		return null;
	}
}
function getTags(parentobj, tag)
{
	if (parentobj == null){
		return new Array();
	}else if (typeof parentobj.getElementsByTagName != 'undefined'){
		return parentobj.getElementsByTagName(tag);
	}else if (parentobj.all && parentobj.all.tags){
		return parentobj.all.tags(tag);
	}else{
		return new Array();
	}
}
function clk(act,id){
	var v = "";
	var o;
	var a = getTags(getObject(id),"input");
	for(var i=0; i<a.length; i++){
		o = a[i];
		if(act=="all"){
			o.checked = true;	
		}else if(act=="un"){
			if(o.checked){
				o.checked = false;
			}else{
				o.checked = true;
			}
		}else{
			var n = a[i].value;
			if(n>0 && a[i].checked){
				v = v + a[i].value + "_";
			}
		}
	}
	if(act=="play"){
		v = v.substring(0,v.length-1);
		if(v.length==0){
			alert("请选择歌曲后再进行连播！");
		}else{
			window.open("http://www.1ting.net/p_"+v+".html","players");
		}
	}
}

function doSearch()
{

	if(document.getElementById("SearchKey").value!="")
	{
		o = document.getElementsByName("Se")
		for(i=0;i<o.length;i++)
			{
				if(o[i].checked) location.href=o[i].value+"?SearchMode=1&SearchKey="+document.getElementById("SearchKey").value;
			}
	}

}
/*
if(location.href=="http://www.1ting.net/")
{
  document.write('<div id="ad" style="position:absolute;z-index:10000"><a href="http://img.1ting.com/Node/Warriors/" target="_blank"><img src="/90x300.jpg" border="0"></a></div>')


  var x = 50,y = 60
  var xin = true, yin = true
  var step = 1 
  var delay = 10
  var obj=document.getElementById("ad") 
  function floatAD() {
     var L=T=0
     var R= document.body.clientWidth-obj.offsetWidth
     var B = document.body.clientHeight-obj.offsetHeight
     obj.style.left = x + document.body.scrollLeft
     obj.style.top = y + document.body.scrollTop
     x = x + step*(xin?1:-1)  
     if (x < L) { xin = true; x = L} 
     if (x > R){ xin = false; x = R} 
     y = y + step*(yin?1:-1) 
     if (y < T) { yin = true; y = T } 
     if (y > B) { yin = false; y = B } 
  }
  var itl= setInterval("floatAD()", delay) 
 obj.onmouseover=function(){clearInterval(itl)} 
 obj.onmouseout=function(){itl=setInterval("floatAD()", delay)}
}
*/