/* This function remove trailing spaces around a given string */
function trim(str) { 
	return( ("" + str).replace(/^\s+/,'').replace(/[\s]+/g,' ').replace(/\s+$/,'') ); 
}
function validEmail(email) {
    if(email == ""){return false;} 
    badStuff = ";:/,' \"\\"; 
    for (i=0; i<badStuff.length; i++) {
        badCheck = badStuff.charAt(i) 
        if(email.indexOf(badCheck,0) != -1){return false;} 
    }
    posOfAtSign = email.indexOf("@",1);
    if(posOfAtSign == -1){return false;}
    if (email.indexOf("@",posOfAtSign+1) != -1){return false;} 
    posOfPeriod = email.indexOf(".", posOfAtSign);
    if (posOfPeriod == -1){return false;} 
    if (posOfPeriod+2 > email.length){return false;}  
	return true; 
}
function isNotNumeric(s) {
  	if(isNaN(s)) {
  		return(true);
  	}
  	return(false);
}
//*****************function for blog*****************************//
function _sadfljafj() {document.write('<div id="popDivWin" style="display:none;"></div>');}

function popDivWinOpen(divID, divW, popTitle, popText, mainBtnLabel, optBtnLabel, submitURL, elemID) {
	
	if(document.getElementById(divID).style.display=='none') {
		document.getElementById(divID).style.display='block';
		var vWidth=divW/2;
		var divX=getX(elemID)-vWidth;
		var browserIS=getBrowser();
		
		if(browserIS=="Firefox" || browserIS=="Mozilla") {
			divX = document.getElementById(elemID).x; 
		}
		
		
		document.getElementById(divID).style.left=divX;
		document.getElementById(divID).style.top=getY(elemID);
		document.getElementById(divID).style.width=divW;
		
		var htmStr="";
		htmStr="<div><table width='100%' border='0' align='center' cellpadding='0' cellspacing='0'><tr><td class='popDivWinHighlight'><table width=100%><tr><td colspan='2' align='center' valign='middle' bgcolor='#FFFFFF' class='brdrall gray_text'><form action='"+submitURL+"' method='post'><table width='95%' border='0' cellspacing='0' cellpadding='0'><tr><td align='left' valign='middle' class='blue_text'>&nbsp;</td></tr><tr><td align='left' valign='middle' class='blue_text'><h2><strong>"+popTitle+"</strong></h2></td></tr><tr><td align='right' class='hrline'></td></tr><tr><td height='8' align='left' valign='top'></td></tr><tr><td align='left' valign='top' class='gray_text'>"+popText+"</td></tr><tr><td height='20' align='left' valign='top'></td></tr><tr><td height='30' align='left'>";
		
		if(trim(mainBtnLabel)!='') {
			htmStr+="<input class='button_background' id='save2' name='save2' value='"+mainBtnLabel+"' type='submit' />";
		}
		
		htmStr+="&nbsp;<input class='button_background' id='Input2' name='Input2' value='"+optBtnLabel+"' type='button' onClick=\"hidePane('"+divID+"');\" /></td></tr><tr><td height='8' align='left' valign='top'></td></tr></table></form></td></tr></table></td></tr></table></div>";
		document.getElementById(divID).innerHTML=htmStr;
	}
	else {
		hidePane(divID);
	}
	return false;
}
function popDivWinOpen_UDXY(divID, divX, divY, divW, popTitle, popText, mainBtnLabel, optBtnLabel, submitURL) {
	if(document.getElementById(divID).style.display=='none') {
		var htmStr="";
		document.getElementById(divID).style.display='block';
		document.getElementById(divID).style.left=divX;
		document.getElementById(divID).style.top=divY;
		document.getElementById(divID).style.width=divW;
		
		htmStr="<table width='100%' border='0' align='center' cellpadding='0' cellspacing='0'><tr><td class='popDivWinHighlight'><table width=100%><tr><td colspan='2' align='center' valign='middle' bgcolor='#FFFFFF' class='brdrall gray_text'><table width='95%' border='0' cellspacing='0' cellpadding='0'><form action='"+submitURL+"' method='post'><tr><td align='left' valign='middle' class='blue_text'>&nbsp;</td></tr><tr><td align='left' valign='middle' class='blue_text'><h2><strong>"+popTitle+"</strong></h2></td></tr><tr><td align='right' class='hrline'></td></tr><tr><td height='8' align='left' valign='top'></td></tr><tr><td align='left' valign='top' class='gray_text'>"+popText+"</td></tr><tr><td height='20' align='left' valign='top'></td></tr><tr><td height='30' align='left'>";
		
		if (trim(mainBtnLabel)!='') {
			htmStr+="<input class='button_background' id='save2' name='save2' value='"+mainBtnLabel+"' type='submit' />";
		}
		
		htmStr+="&nbsp;<input class='button_background' id='Input2' name='Input2' value='"+optBtnLabel+"' type='button' onclick='hidePane("+divID+");' /></td></tr><tr><td height='8' align='left' valign='top'></td></tr></form></table></td></tr></table></td></tr></table>";
		document.getElementById(divID).innerHTML=htmStr;
	}
	return false;
}