//Function to jump to another forum
function ForumJump(URL) {
	
	if (URL.options[URL.selectedIndex].value != "") self.location.href = URL.options[URL.selectedIndex].value;	
	return true;
}

//Function to open pop up window
function openWin(theURL,winName,features) {
  	window.open(theURL,winName,features);
}


//Function to open preview post window
function OpenPreviewWindow(targetPage, formName){
	
	now = new Date  
	
	//Open the window first 	
   	openWin('','preview','toolbar=0,location=0,status=0,menubar=0,scrollbars=1,resizable=1,width=680,height=400')
   		
   	//Now submit form to the new window
   	formName.action = targetPage + "?ID=" + now.getTime();	
	formName.target = "preview";
	formName.submit();
}

//'**************************************** 
//'******Image Resize & Player MOD******** 
//'*************-- Start --**************** 
//'***WWF china Http://Www.CnWWF.Com/***** 
//'**************************************** 
//'***********old Code ************ 
//'***********old Code ************      
function WWFchina_ResizeIMG(o){ 
     var zoom=parseInt(o.style.zoom, 10)||100;zoom+=event.wheelDelta/12;if (zoom>0) o.style.zoom=zoom+'%'; 
     return false; 
} 
//'**************************************** 
//'******Image Resize & Player MOD******** 
//'*************-- End--**************** 
//'***WWF china Http://Www.CnWWF.Com/***** 
//'****************************************


function ReplaceURLvariableHTML(strURLvariable,strURLvalue)
{
	if (strURLvalue != ""){ 
			var strUrl=document.location.href;
			var strSearch=document.location.search;
			if (strSearch!=""){
				var intNumA=strUrl.indexOf(strURLvariable);
				if(intNumA==-1){strUrl = strUrl+'&'+strURLvariable+'=' + strURLvalue;}
				else{
					var intNumB=strUrl.indexOf('&',intNumA);
					if(intNumB=-1){
						intNumA=intNumA+strURLvariable.length+1;
						var strTmp = strURLvariable+'='+strUrl.substr(intNumA,strSearch.length);
						strUrl = strUrl.replace(strTmp,strURLvariable+'='+strURLvalue);
					}
					else
					{
						intNumA=intNumA+strURLvariable.length+1;
						var strTmp = strURLvariable+'='+strUrl.substr(intNumA,intNumB);
						strUrl = strUrl.replace(strTmp,strURLvariable+'='+strURLvalue);
					}
					}
			}
			else{strUrl = document.location.href+'?'+strURLvariable+'='+ strURLvalue;}
	document.location.href=strUrl;
	}
}
function hideshow(which,img,imgsrc){
	var now = new Date();
	now.setTime(now.getTime() + 1000 * 60 * 60 * 24 * 365)
	if(document.all && !document.getElementById) {
		document.getElementById = function(id) {
			 return document.all[id];
		}
	}
	if (document.getElementById){
		oWhich = document.getElementById(which).style;
		oImage = document.getElementById(img );}
	else
		if (document.layers) {
			oWhich = document.layers[which];
			oImage = document.layers[img];}
	window.focus();
	
	if (oWhich.display == "none"){
		oWhich.display = "";
		oImage.src = imgsrc + "CatBox/hide_min.gif"
		oImage.alt = "";
		setCookie(which,"show","/",now);
		}
	else{
		oWhich.display = "none";
		oImage.src = imgsrc + "CatBox/hide_max.gif";
		oImage.alt = "";
		setCookie(which,"hide","/",now);
		}
}
function setCookie(name, value, path, expires, domain, secure){
	 document.cookie = name + "=" +escape(value) +
        ((expires) ? ";expires=" + expires.toGMTString() : "") +
        ((path) ? ";path=" + path : "") + 
        ((domain) ? ";domain=" + domain : "") +
        ((secure) ? ";secure" : "");	
		
}
