var oLastSelectedMenu;
function fPaintMenu(obj, sColor){
/*
	if(oLastSelectedMenu){
		//oLastSelectedMenu.style.background='#F4F4F4';
		oLastSelectedMenu.style.background="url(../images/mainmenu_bg.gif) repeat-x top";
		oLastSelectedMenu=null;
	}
	if(obj){
		obj.style.background=sColor +" url(../images/mainmenu_bg.gif) repeat-x top";
//		obj.style.background=sColor;
		oLastSelectedMenu=obj
	}
*/
}

function fSlideTitle(txt){
	var obj=document.getElementById("oSlideTitle")
	if(txt)
		obj.outerHTML='<marquee id="oSlideTitle" style="width:90px; height:20px;" width="90" height="20" direction="up" behavior="slide" scrollamount="5" scrolldelay="10">'+ txt +'</marquee>';
	else
		obj.innerHTML="";
}

		var oScrollThumbsTimer;
		function fScrollThumbs(bMove, nDirection){
			if(bMove)
				oScrollThumbsTimer=setInterval("fDoScroll("+ nDirection +")", 40)
			else
				clearInterval(oScrollThumbsTimer);
		}

		function fDoScroll(nDirection){
			var obj=document.getElementById("oConnectedUsers");
			obj.scrollTop=(nDirection==1 ? obj.scrollTop+1 : obj.scrollTop-1);
		}


// <script type="text/javascript">
//	fWriteFlashObject(nID, sUrl, nWidth, nHeight, sBG, bTransparent, sCssClass, bLiveCon, bAutoResize)
// </script>

function fWriteFlashObject(sID, sUrl, nWidth, nHeight, sBG, bTransparent, sCssClass, bLiveCon, bAutoResize){
	var sSSL=(location.href.indexOf("https")>=0 ? "s" : "");
	document.write('<object '+ (bAutoResize ? 'style="display:none;"' : '') +' id="'+ sID +'" width="'+ nWidth +'" height="'+ nHeight +'" class="'+ sCssClass +'" swLiveConnect="'+ (bLiveCon ? 'true' : 'false') +'" codebase="http"+ sSSL +"://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=6,0,0,0" classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000">')
	document.write('<param name="movie" value="'+ sUrl +'">')
	if(bTransparent) document.write('<param name="wmode" value="transparent" />');
	document.write('<param name="bgcolor" value="'+ sBG +'" />');
	document.write('<param name="quality" value="high">');
	document.write('<embed id="'+ sID +'" src="'+ sUrl +'" width="'+ nWidth +'" height="'+ nHeight +'" class="'+ sCssClass +'" bgcolor="'+ sBG +'" '+ (bTransparent ? 'wmode="transparent"' : '') +' quality="high"  TYPE="application/x-shockwave-flash" PLUGINSPAGE="http"+ sSSL +"://www.macromedia.com/go/getflashplayer"></embed>')
	document.write('</object>');

	if(bAutoResize){
		var obj=document.getElementById(sID)
		obj.width=obj.GetVariable('Stage.width');
		obj.height=obj.GetVariable('Stage.height');
		obj.style.display="block";
	}
}


function fWriteMovieObject(sUrl){
	if(!sUrl) return false;
	var nHeight=0, sExt=sUrl.substr(sUrl.length-3, sUrl.length);
	if(sExt=="wma" || sExt=="mp3")
		nHeight=150
	else{
		if(sExt=="wmv")
			nHeight=320
		else
			return false;
	}

	document.write('<object width="320" height="'+ nHeight +'" classid="CLSID:6BF52A52-394A-11d3-B153-00C04F79FAA6">')
		document.write('<param name="url" value="'+ sUrl +'">')
		document.write('<param name="uimode" value="full">');
		document.write('<param name="autostart" value="-1">');
		document.write('<param name="rate" value="1">');
		document.write('<param name="balance" value="0">');
		document.write('<param name="currentPosition" value="-1">');
		document.write('<param name="defaultFrame" value>');
		document.write('<param name="playCount" value="1">');
		document.write('<param name="currentMarker" value="0">');
		document.write('<param name="invokeURLs" value="-1">');
		document.write('<param name="baseURL" value>');
		document.write('<param name="volume" value="50">');
		document.write('<param name="mute" value="0">');
		document.write('<param name="stretchToFit" value="0">');
		document.write('<param name="windowlessVideo" value="0">');
		document.write('<param name="enabled" value="-1">');
		document.write('<param name="enableContextMenu" value="-1">');
		document.write('<param name="fullScreen" value="0">');
		document.write('<param name="SAMIStyle" value>');
		document.write('<param name="SAMILang" value>');
		document.write('<param name="SAMIFilename" value>');
		document.write('<param name="captioningID" value>');
		document.write('<param name="enableErrorDialogs" value="0">');
		document.write('<embed width="320" height="320" src="'+ sUrl +'" filename="'+ sUrl +'" autostart="True" showcontrols="True" showstatusbar="True" showdisplay="True" autorewind="True"></embed> ');
	document.write('</object>');
}


// THIS FUNCTION GENERATES FAKE <A HREF="MAILTO:..."> TAG
function fPrintEmailLink(sUserName, sDomain, linkText, linkTitle, cssClass, sSubject, sBody){
	var sQS=""
	if(!sUserName || !sDomain) return false;
	var sLinkText=linkText||null, sLinkTitle=linkTitle||null, sCssClass=cssClass||null;
	if(!sLinkText) sLinkText=sUserName +"@"+ sDomain;

	if(sSubject || sBody) sQS+="?";
	if(sSubject) sQS+="subject="+ sSubject;
	if(sSubject && sBody) sQS+="&";
	if(sBody) sQS+="body="+ sBody;

	if(sLinkTitle) sLinkTitle=" title='"+ sLinkTitle +"'"
	if(sCssClass) sCssClass=" class='"+ sCssClass +"'"

	document.write("<a "+ sLinkTitle +" "+ sCssClass +" href='m&#97;ilto:"+ sUserName +"&#64;"+ sDomain + sQS +"'>"+ sLinkText +"</a>")
}


function PopUp(url, width, height){
	window.open(url,null,"width="+(width||500)+", height="+(height||300)+", scrollbars=yes, resizable=no")
}

function fPopupImage(url){
	if(url) window.open("imgPopUp.asp?url="+ url,"winPopupImage","width=5,height=5")
}

function fSendToFriend(isEng){
	window.open("/newsite/Send2Friend.asp?title="+ document.title, "winSendToFriend", "width=400,height=390");
}

function fPrintPage(isEng){
	window.open('print.asp', 'winPrint', 'width=700, height=400, scrollbars=yes');
}

var oLastTab;
function fChangePage(id){
	document.getElementById("oContentText").innerHTML=document.getElementById("oTab" + id).innerHTML;
	document.getElementById("oLeftImages").innerHTML=document.getElementById("oTabImages" + id).innerHTML;
	if(oLastTab) oLastTab.className="clsTab";
	oLastTab=document.getElementById("oTabBtn"+ id);
	oLastTab.className="clsTab_selected";
}

function fContentAddReply(Id){
	window.open("ContentReply.asp?Id="+ Id + "&title="+ document.title, "winSendToFriend", "width=400,height=390");
}
