// Show Hide Poll 
function showpoll() {
	p=document.getElementById('poll');
	pf=document.getElementById('pollform');
	pr=document.getElementById('pollresult');
	tks=document.getElementById('thanks');
	bp=document.getElementById('btnpoll');
	if(pf.style.display=='block' || pr.style.display=='block' || tks.style.display=='block') {
		pr.style.display='none';
		pf.style.display='none';
		tks.style.display='none';
		p.className='down';
	}
	else {
		pf.style.display='block';
		pr.style.display='none';
		tks.style.display='none';
		p.className='up';
	}
}
function showform() {
	pf.style.display='block';
	tks.style.display='none';
	pr.style.display='none';
}
function showresult() {
	pf.style.display='none';
	tks.style.display='none';
	pr.style.display='block';
}
function hidepoll() {
	pf.style.display='none';
	pr.style.display='none';
	tks.style.display='none';
}

function WriteFlash(flash,_width,_height) {
	document.writeln("<object classid=\"clsid:D27CDB6E-AE6D-11cf-96B8-444553540000\" codebase=\"http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=7,0,19,0\" width=\"" + _width + "\" height=\"" + _height + "\">");
	document.writeln("  <param name=\"movie\" value=\"" + flash + "\" />");
	document.writeln("  <param name=\"quality\" value=\"high\" />");
	document.writeln("  <param name=\"wmode\" value=\"transparent\" />");
	document.writeln("  <embed src=\"" + flash + "\" quality=\"high\" pluginspage=\"http://www.macromedia.com/go/getflashplayer\" type=\"application/x-shockwave-flash\" width=\"" + _width + "\" height=\"" + _height + "\" wmode=\"transparent\"></embed>");
	document.writeln("</object>");
 
}

function banner() {
	var startNum=1;
	var endNum=6;
	var randomNumber = Math.round(Math.random()*(endNum-startNum))+startNum;
	var flash='http://www.zdexp.com/attachment/media/banner' +randomNumber+ '.swf';
	var _width=530;
	var _height=172;
	document.writeln("<object classid=\"clsid:D27CDB6E-AE6D-11cf-96B8-444553540000\" codebase=\"http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=7,0,19,0\" width=\"" + _width + "\" height=\"" + _height + "\">");
	document.writeln("  <param name=\"movie\" value=\"" + flash + "\" />");
	document.writeln("  <param name=\"quality\" value=\"high\" />");
	document.writeln("  <param name=\"wmode\" value=\"transparent\" />");
	document.writeln("  <embed src=\"" + flash + "\" quality=\"high\" pluginspage=\"http://www.macromedia.com/go/getflashplayer\" type=\"application/x-shockwave-flash\" width=\"" + _width + "\" height=\"" + _height + "\" wmode=\"transparent\"></embed>");
	document.writeln("</object>");
 
}

function PlayFlash(flash,_width,_height) {
	document.writeln("<object classid=\"clsid:d27cdb6e-ae6d-11cf-96b8-444553540000\" codebase=\"http://fpdownload.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=7,0,0,0\" width=\"" + _width + "\" height=\"" + _height + "\" id=\"fullscreen\" align=\"middle\">");
	document.writeln("  <param name=\"allowScriptAccess\" value=\"sameDomain\" />");
	document.writeln("  <param name=\"movie\" value=\"movieplayer.swf\" />");
	document.writeln("  <param name=\"quality\" value=\"high\" />");
	document.writeln("  <param name=\"salign\" value=\"mc\" />");
	document.writeln("  <param name=\"bgColor\" value=\"#ffffff\" />");
	document.writeln("  <param NAME=FlashVars VALUE=\"vidpath=" + flash + "\" />");
	document.writeln("  <embed src=\"movieplayer.swf\" FlashVars=\"vidpath=" + flash + "\" quality=\"high\" salign=\"mc\" bgcolor=\"#ffffff\" width=\"" + _width + "\" height=\"" + _height + "\" name=\"fullscreen\" align=\"middle\" allowScriptAccess=\"sameDomain\" type=\"application/x-shockwave-flash\" pluginspage=\"http://www.macromedia.com/go/getflashplayer\" />");
	document.writeln("</object>");
}

	function showImage(image,validWidth,validHeight)
	{
		var img = new Image();
		img.src = image.src;
		var zoom = validWidth * 100 / img.width;
		if(zoom > validHeight * 100 / img.height)
			zoom = validHeight * 100 / img.height;
		zoom = zoom > 100 ? 100 : zoom;
		image.width = parseInt(img.width * zoom / 100, 10);
		image.height = parseInt(img.height * zoom / 100, 10);
	}


var flag=false;
function showImagedd(ImgD,iwidth,iheight)
{    var image=new Image();
    image.src=ImgD.src; 
 if(image.width>0 && image.height>0)
 {  flag=true;
    if(image.width/image.height>= iwidth/iheight)
	{    if(image.width>iwidth){         ImgD.width=iwidth;   ImgD.height=(image.height*iwidth)/image.width;   }
	       //else{       ImgD.width=image.width;     ImgD.height=image.height;       }
    }
    else{
           if(image.height>iheight){   ImgD.height=iheight;   ImgD.width=(image.width*iheight)/image.height;  }
			//else{   ImgD.width=image.width;     ImgD.height=image.height;      }
        }
  }
} 



//window.onload = fixed;
function fixed(){
	if(document.getElementById("side")!="undefined"){
	var righth=document.getElementById("side");
	var righthp=righth.scrollHeight;
	if (righthp<369)	{righth.style.height="369px";	}
	var midh=document.getElementById("content");
	var midhp=midh.scrollHeight;
	if (midhp<369)	{midh.style.height="100%";	}
	//if (righthp<midhp)	{righth.style.height=500+'px';	}else righth.style.height=midhp+"px";
    }
}
function c(one,two,three)	{	}

function isBlank( s )
{	var len = s.length;
	var result = true;
	for( i = 0; i < len; i++ ) {if( s.charAt(i) != " " ) {	result = false;	break;	}	}
	return result;
}
function checkSearchValue()
{	var curForm = document.frm_fulltextsearch; 
	if(curForm.keyword.value == "Keyword") { curForm.keyword.value = "";}
	if( isBlank(curForm.keyword.value) )
	{	alert( "please fill in the key words!" );
		curForm.keyword.focus();
		return false;
	}
	return true;
}

window.moveTo(0,0);
window.resizeTo(screen.availWidth,screen.availHeight);