function createCookie(name,value,days){
     var argv=createCookie.arguments;
     var argc=createCookie.arguments.length;
     //var expires=(2<argc)?argv[2]:null;
     //var path=(3<argc)?argv[3]:null;
     //var domain=(4<argc)?argv[4]:null;
     //var secure=(5<argc)?argv[5]:false;
	if (days) { 
		var expires = new Date(); 
		expires.setTime(expires.getTime()+(days*24*60*60*1000)); 
		//var expires = date.toGMTString(); 
	}
	 var path = '/';
	 //var domain = '369.com';
	 var domain = null;
	 var secure = false;
     document.cookie=name+"="+escape(value)+((expires==null)?"":("; expires="+expires.toGMTString()))+((path==null)?"":("; path="+path))+((domain==null)?"":("; domain="+domain))+((secure==true)?"; secure":"");
}
function readCookie(Name) {
 var search = Name + "=";
 var returnvalue = "";
 if (document.cookie.length > 0) {
  offset = document.cookie.lastIndexOf(search);
  if (offset != -1) {
   offset += search.length;
   end = document.cookie.indexOf(";", offset);
   if (end == -1)
   end = document.cookie.length;
   returnvalue=unescape(document.cookie.substring(offset,end));
  }
 }
 return returnvalue;
}

document.getElementsByClassName = function(className,oBox) {
 this.d= oBox || document;
 var children = this.d.getElementsByTagName('*') || document.all;
 var elements = new Array();
 for (var i = 0; i < children.length; i++) {
 var child = children[i];
 var classNames = child.className.split(' ');
 for (var j = 0; j < classNames.length; j++) {
 if (classNames[j] == className) {
 elements.push(child);
 break;
 }
 }
 }
 return elements;
}

$Cls = function (s,o){return document.getElementsByClassName(s,o);};


function chgMyHit(stat){//OK
  createCookie("MyHitStatus",stat, 180);
  GetMyHit();
}

//style
function setActiveStyleSheet(title) { 
  var i, a, main; 
	if (title != '') {
		document.getElementById('skintheme').href="../style/style"+title+".css?090401";
	} else {
		document.getElementById('skintheme').href="../style/style1.css?090401";
	}
	createCookie('skintheme', title, 30);
	var bodyBgImage = readCookie('bodyBgImage');
	if (!(bodyBgImage != '' && bodyBgImage != 'none')) {
		set_line_bg_color(true, 1);
	}
}

var cookie = readCookie("skintheme"); 
if (cookie && cookie != '1' && cookie != '6') {
	document.getElementById('skintheme').href = "../style/style"+cookie+".css?090401";
}

//box
function changea4(srcObj,tid) {
var tabList = srcObj.parentNode.getElementsByTagName("li");
if(srcObj.className=='b')return;
for(var i=0;i<tabList.length;i++){
if(tabList[i].className=='b')tabList[i].className='a';
//document.getElementById("card"+(i+1)).style.display = 'none';
}
//document.getElementById("card"+tid).style.display ='';
srcObj.className ='b';//TABĒŠ»»
return false;
}
function changea2(srcObj,tid) {
var tabList = srcObj.parentNode.getElementsByTagName("li");
if(srcObj.className=='b1')return;
for(var i=0;i<tabList.length;i++){
if(tabList[i].className=='b1')tabList[i].className='a1';
document.getElementById("mz"+(i+1)).style.display = 'none';
}
document.getElementById("mz"+tid).style.display ='';
srcObj.className ='b1';//TABĒŠ»»
return false;
}