brIE = "Microsoft Internet Explorer"; brNS = "Netscape"; brOP = "Opera"; brN = "undefined"; brM = 1 ; brV=0;
if (navigator.appName == brIE) {brN = "IE"; brV = parseFloat(navigator.appVersion.substr (navigator.appVersion.lastIndexOf("MSIE") + 4, 4)); brM = 1;}
if (navigator.appName == brNS) {brN = "NS"; brV = parseFloat(navigator.appVersion.substr(0,4)); brM = 2;}
if (navigator.appName == brOP) {brN = "OP"; brV = parseFloat(navigator.appVersion.substr(0,4)); brM = 1;}
if (brN == 'NS' && brV >= 5) {brM = 3;}

function GetObj(n, d) {
  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=GetObj(n,d.layers[i].document);
  if(!x && d.getElementById) x=d.getElementById(n); return x;
}

function SetVis() { 
  var i,p,v,obj,args=SetVis.arguments;
  for (i=0; i<(args.length-2); i+=3) if ((obj=GetObj(args[i]))!=null) { v=args[i+2];
    if (obj.style) { obj=obj.style; v=(v=='show')?'visible':(v=='hide')?'hidden':v; }
    obj.visibility=v; }
}

function Show(TheID) { SetVis(TheID,'','show') }  
function Hide(TheID) { SetVis(TheID,'','hide') }  

function Move(x, y, o) {
  if(brN == 'NS') {
    if(brV == 5) { o.style.left = x; o.style.top = y; }
    if(brV == 4) { o.left = x; o.top = y;}
  } else { o.style.pixelLeft = x; o.style.pixelTop = y; }
}

function Link(TheLink) {
	if (TheLink.charAt(0) =="*") {
		window.open(TheLink.substring(1,TheLink.length));
		} else {
	  top.location.href = TheLink;
		}
}


var rotCur = 1;
var rotPlaying = true;

function rotInit() {
	for (i=1;i<=5;i++) {document.images["rotThm" + i].src = rotImages[i];}
}

function rotJump(ThePos) {
	  for (i=1;i<=5;i++) {document.images["rotInd" + i].src="/images/interface/RotEmpty.jpg";}
  	document.images["rotInd" + ThePos].src="/images/interface/RotArrowUp.gif";
		document.getElementById("rotText").innerHTML = rotTexts[ThePos];
		document.images["rotImg"].src = rotImages[ThePos];
		rotCur = ThePos
	}

  function rotNext() {
	  if(rotPlaying) {
	    rotCur = rotCur + 1;
		  if (rotCur>5) {rotCur=1};
		  rotJump(rotCur);
		}	
    setTimeout("rotNext()", 5000);
	}
	
	function rotStat(TheStat) {
	  rotPlaying = TheStat;
		if (TheStat) {rotNext();}
	}
	
	function rotLink(ThePos) {
	  document.location.href= "/index.asp?id=" + rotLinks[ThePos];
	}


function calShow(TheText) {
	document.getElementById("calDiv").innerHTML = TheText;	
}
	
function calJump(TheID) {
	if (TheID!=0) {document.location.href="/index.asp?id=" + TheID}
}

function Anket(ThePoll, TheAns) {
  document.location.href="/anket.asp?id=" + ThePoll + "&ans="	+ TheAns;
}

function PlayUrl(TheUrl) {
	if(window.FlvPlayer) window.document["FlvPlayer"].SetVariable("pu", TheUrl);
	if(document.FlvPlayer) document.FlvPlayer.SetVariable("pu", TheUrl);
}

function OpenWin(theURL,winName,features) {
  window.open(theURL,winName,features);
}

function PopupImage(TheImage) {
  OpenWin("/popupImage.asp?f=/images/" + TheImage ,"wndPictureBrowser","width=300,height=300,resizable=yes,status=no,scrollbars=no,toolbar=no,location=no,menu=no");	
}

var popupPos = -2000;

function PopupMove() {
	popupPos = popupPos + 50;
	if (popupPos<(document.body.clientWidth/2)-250) {Move(popupPos,80,GetObj("popupDiv"));}
  setTimeout("PopupMove()", 50);
}

function PopupClose() {
  Hide("popupDiv");
}

