function checkSearchForm(txtField) {
	if (txtField.value == '') {
		event.returnValue=false;
		alert('You should type a keyword!');
	}
}

function popUpImage(path,w,h,title,scroll,resize) {
	if (resize == 1){
		resize = 'yes'
	}
	else {
		resize = 'no'
	}
	if (scroll == 1){
		scroll = 'yes'
	}
	else {
		scroll = 'no'
	}


popupImg = window.open('','popupImg'+w+h,config='width='+w+',height='+h+',toolbar=no,menubar=no,scrollbars='+scroll+',resizable='+resize+',location=no,status=no');

		popupImg.document.write('<html><head><title>');
		popupImg.document.write(title);
		popupImg.document.write('</title>');
		popupImg.document.write('<style>body {margin:0;}</style>');
		popupImg.document.write('</head>');
		popupImg.document.write('<script language="JavaScript" type="text/javascript">');
		popupImg.document.write(' function doR () {');

		popupImg.document.write('if (document.getElementById(\'pimg\').width > screen.availWidth)');
		popupImg.document.write('{ var wid = screen.availWidth - 100 }');
		popupImg.document.write('else { var wid = document.getElementById(\'pimg\').width }');
		popupImg.document.write('if (document.getElementById(\'pimg\').height > screen.availHeight)');
		popupImg.document.write('{ var hei = screen.availHeight - 100 }');
		popupImg.document.write('else { var hei = document.getElementById(\'pimg\').height }');

		/*popupImg.document.write('window.resizeTo(wid,hei);');*/

		/*popupImg.document.write('var halfWid = ((screen.availWidth-document.getElementById(\'pimg\').width ) / 2);');
		popupImg.document.write('var halfHei = ((screen.availHeight-document.getElementById(\'pimg\').height ) / 2);');

		popupImg.document.write('if (document.getElementById(\'pimg\').width > screen.availWidth)');
		popupImg.document.write('{ var moveWid = 50; }');
		popupImg.document.write('else { var moveWid = halfWid }');
		popupImg.document.write('if (document.getElementById(\'pimg\').height > screen.availHeight)');
		popupImg.document.write('{ var moveHei = 50; }');
		popupImg.document.write('else { var moveHei = halfHei; }');

		popupImg.document.write('window.moveTo(moveWid,moveHei);');*/

		popupImg.document.write('}');
		popupImg.document.write('</script>');
		popupImg.document.write('<body onload="doR();">');
		popupImg.document.write('<a href="javascript:window.close();opener.focus();">');
		popupImg.document.write('<img src="'+path+'" width="'+w+'" height="'+h+'" name="pimg" id="pimg" border="0" alt="'+title+'" title="'+title+'">');
		popupImg.document.write('</a>');
		popupImg.document.write('</body>');
		popupImg.document.write('</html>');
		popupImg.document.close();
		popupImg.focus();
}



function makePopUp(urlValue,widthValue,heightValue) {
    var leftPos = (screen.availWidth-900) / 2;
    var topPos = (screen.availHeight-600) / 2;
    NewWidthValue=widthValue+20;
    NewHeightValue=heightValue+20;
    return window.open(urlValue, 'PopUpWindow','width='+NewWidthValue+',height='+NewHeightValue+',menubar=0,scrollbars=yes,resizable=yes,statusbar=no,location=no,titlebar=0,toolbar=0,status=0,top=' + topPos + ',left=' + leftPos);

}

function preloadImages(){
	var d = document;  if(!d.pics) d.pics = [];
	for(var i = 0, a = preloadImages.arguments; i < a.length; i++)
		(d.pics[d.pics.length] = new Image()).src = a[i];
}

function AddBookmark(){
  if (document.all)
    window.external.AddFavorite(document.location.href,document.title)
}

function GoURL(s){
  document.location = s;
}

function RePopUp(oLink) {
	if (oLink.target == 'PopUp') {
		if (oLink.href.match(/(jpg)|(png)|(gif)$/i)) {
			win = makePopUp(oLink.href,400,330);
			win.document.open("text/html");
			win.document.write('<html><head><title>'+txt_rePopUpTitle+'</title></head><script language="JavaScript" type="text/javascript">function GetLayer(name) {return ((eval(document.all))?(document.all[name]):(document.getElementById(name)))} function doR () { window.resizeTo(GetLayer(\'pimg\').width+13,GetLayer(\'pimg\').height+37)}</script><body onload="doR();" bgcolor="#ffffff" style="margin:0px;text-align:center;"><a href="#" onclick="window.close()"><img src="'+oLink.href+'" name="pimg" id="pimg" alt="" border="0"/></a></body></html>');
			win.document.close();
		} else {
			makePopUp(oLink.href,400,330);
		}	
		return false;
	}
	return true;
} 

function Enlarge(Img,title) {
	if (Img!="") {
		win = makePopUp(Img,400,330);
		win.document.open("text/html");
		win.document.write('<html><head><title>'+title+'</title></head><script language="JavaScript" type="text/javascript">function GetLayer(name) {return ((eval(document.all))?(document.all[name]):(document.getElementById(name)))} function doR () { window.resizeTo(GetLayer(\'pimg\').width+13,GetLayer(\'pimg\').height+37)}</script><body onload="doR();" bgcolor="#ffffff" style="margin:0px;text-align:center;"><a href="#" onclick="window.close()"><img src="'+Img+'" name="pimg" id="pimg" alt="" border="0"/></a></body></html>');
		win.document.close();
	} 
	return false;
} 


