/* add rel = "external" to links instead of target="_blank" */


function externallink() { 
if (!document.getElementsByTagName) return; 
var anchors = document.getElementsByTagName("a"); 
for (var i=0; i<anchors.length; i++) { 
var anchor = anchors[i]; 
if (anchor.getAttribute("href") && anchor.getAttribute("rel") == "external") 
anchor.target = "_blank"; 

anchor.className = (anchor.className != '') ? anchor.className+' external' : 'external';
} 
} 
window.onload = externallink;

function popupwindow(url,windowname,config) {
window.open(url,windowname,config);
}


function MM_openBrWindow(theURL,winName,features) { //v2.0
window.open(theURL,winName,features);
}


function validatequeryform()
{
var name = document.forms.infoform.name.value;
if(!name)
{
alert("please give your name!");
document.forms.infoform.name.focus();
return false;
}

var email = document.forms.infoform.email.value;
if(!email)
{
alert("please give your email address!");
document.forms.infoform.email.focus();
return false;
}

if(email)
{
var result = false
var addressentered = new String(email)
var atsymbolpos = addressentered.indexOf("@");
if(atsymbolpos > 0)
{
var dotpos = addressentered.indexOf(".",atsymbolpos);
if((dotpos > atsymbolpos+1) && (addressentered.length > dotpos+1))
result = true;
}
if(result==false)
{
alert("please give a valid email address!");
document.forms.infoform.email.focus();
return false;
}
}

var query = document.forms.infoform.query.value;
if(!query)
{
alert("you haven't entered any query text!");
document.forms.infoform.query.focus();
return false;
}

var querytype = document.forms.infoform.querytype.value;
if(!querytype)
{
alert("please indicate the nature of this query with the pop-up by the submit button!");
document.forms.infoform.querytype.focus();
return false;
}

}