/////////////POP IMAGE////////////
function popImage(imageURL,imageTitle){
	defaultWidth  = 500;
	defaultHeight = 500;
	//alert(imageURL+imageTitle);
	var optNN='scrollbars=no,width='+defaultWidth+',height='+defaultHeight+',left=100,top=100';
	var optIE='scrollbars=no,width=150,height=100,left=100,top=100';

	var AutoClose = true;

	if (parseInt(navigator.appVersion.charAt(0))>=4){
		var isNN=(navigator.appName=="Netscape")?1:0;
		var isIE=(navigator.appName.indexOf("Microsoft")!=-1)?1:0;}
		var optNN='scrollbars=yes,width='+defaultWidth+',height='+defaultHeight+',left=100,top=100';
		var optIE='scrollbars=yes,width=150,height=100,left=100,top=100';

		//if (isNN){imgWin=window.open('about:blank','',optNN);}
		if (isNN){imgWin=window.open('about:blank','',optNN);}
		if (isIE){imgWin=window.open('about:blank','',optIE);}
		with (imgWin.document){
			writeln('<html><head><title>Loading...</title><style>body{margin:0px;}</style>');
			writeln('<sc'+'ript>');
			writeln('var isNN,isIE;');
			writeln('if (parseInt(navigator.appVersion.charAt(0))>=4){');
			writeln('isNN=(navigator.appName=="Netscape")?1:0;');
			writeln('isIE=(navigator.appName.indexOf("Microsoft")!=-1)?1:0;}');
			writeln('function reSizeToImage(){');
			writeln('if (isIE){');
			writeln('window.resizeTo(100,100);');
			writeln('width=100-(document.body.clientWidth-document.images[0].width);');
			writeln('height=100-(document.body.clientHeight-document.images[0].height);');
			writeln('window.resizeTo(width,height);}');
			writeln('if (isNN){');
			writeln('window.innerWidth=document.images["Image"].width;');
			writeln('window.innerHeight=document.images["Image"].height;}}');
			writeln('function doTitle(){document.title="'+imageTitle+'";}');
			writeln('</sc'+'ript>');
			if (!AutoClose) writeln('</head><body bgcolor=000000 scroll="no" onload="reSizeToImage();doTitle();self.focus()">')
			else writeln('</head><body bgcolor=000000 scroll="no" onload="reSizeToImage();doTitle();self.focus()">');
			writeln('<img name="Image" src="'+imageURL+'" style="display:block"></body></html>');
			close();
		}
}
function validateContactus(){
	var root = document.contactus;
	var name = root.name;
	var email = root.email;
	var subject = root.subject;
	var message = root.message;
	var code = root.vcode;
	
	if(name.value==''){
		alert("Please enter your name.");
		name.focus();
		return false;
	}
	var email = root.email;
	if(email.value==''){
		alert('Please supply your email');
		email.focus();
		return false;
	}
	
	var pattern = /^\w+([\.-]?\w+)*@\w+([\.-]?\w+)*(\.\w{2,4})+$/;
	flag=root.email.value.match(pattern);
	if(!flag){
		alert('Please insert a valid email address.');
		root.email.select();
		return false;
	}
	if(subject.value==''){
		alert("Please enter a subject.");
		subject.focus();
		return false;
	}
	if(message.value==''){
		alert("Please enter your message.");
		message.focus();
		return false;
	}
	if(code.value==''){
		alert("Please enter the visual code.");
		code.focus();
		return false;
	}
	return true;
}
function clearForm(){
	var status = confirm("Are you sure you want to clear the form?");
	if(status == false)
		return false;
	
	var root = document.contactus;
	var name = root.name;
	var email = root.email;
	var subject = root.subject;
	var message = root.message;
	var code = root.vcode;
	name.value='';
	email.value='';
	subject.value='';
	message.value='';
	code.value='';
	return false; 
}
function validateSearch(){
	var root = document.search;
	var keyword = root.keyword;
	
	if(keyword.value==''){
		alert("Please provide a keyword.");
		keyword.focus();
		return false;
	}
	return true;
}
