// JavaScript Document
/* 
	@description: All header related scripts should be placed here
	@author: Taufeeq ur Rehman
	@company: MBlue Designs RWP. Pakistan
*/
function MM_jumpMenu(targ,selObj,restore){ //v3.0
  eval(targ+".location='"+selObj.options[selObj.selectedIndex].value+"'");
  if (restore) selObj.selectedIndex=0;
}
function submitForm(frm,val){
	if(val > 0){
		frm.page.value = val;
	}
	frm.submit();
}
function openBrWindow(theURL,winName,features) { //v2.0
  window.open(theURL,winName,features);
}

/*
	@function: validateNewsLetter
	@description: validating the newsletter email 
	@params: form
	@return: bool result
	@author: Taufeeq ur Rehman
*/
function validateNewsLetter(frm){
	frm.news_email.className="txtbox_style";
	if(!(/^\w+([\.-]?\w+)*@\w+([\.-]?\w+)*(\.\w{2,3})+$/.test(frm.news_email.value))){
		frm.news_email.value = "Invalid email address";
		frm.news_email.className="error";
		return false;
	}else{
		frm.news_email.className="txtbox_style";
		return true;
	}
}
/*
	@function: emptyNews
	@description: Empty the email box if it contains error msg 
	@params: ctrl
	@author: Taufeeq ur Rehman
*/

function emptyNews(ctrl){
	if(ctrl.value == 'Invalid email address')
	ctrl.value = "";
}