var displayWin;

function smsPopUp(url,width,height,scroll){
   	
    var query="";
   	var flag=0;
   	if(scroll=="yes"){query=",resizable=yes,scrollbars=yes,outerHeight="+height+",outerWidth="+width;}
   	
   	offsetX = (screen.width - width)/1.2;
   	if(offsetX<0){ offsetX = 10; }
   
   	offsetY = (screen.height - height)/1.6;
   	if(offsetY<0){ offsetY = 10; }
   	if(displayWin != null){
   		displayWin.close();
   		displayWin = window.open(url,"win","status=no,width="+width+",height="+height+",top="+offsetY+",left="+offsetX+query);
   	}else{
   		displayWin = window.open(url,"win2","status=no,width="+width+",height="+height+",top="+offsetY+",left="+offsetX+query);
   	}
}

function popUp(url,width,height,scroll){
    var query="";
   	var flag=0;
   	if(scroll=="yes"){query=",resizable=yes,scrollbars=yes,outerHeight="+height+",outerWidth="+width;}
   	
   	offsetX = (screen.width - width)/2;
   	if(offsetX<0){ offsetX = 10; }
   
   	offsetY = (screen.height - height)/2;
   	if(offsetY<0){ offsetY = 10; }
   
   	if(displayWin != null){
   		displayWin.close();   	
   		displayWin = window.open(url,"win","status=no,width="+width+",height="+height+",top="+offsetY+",left="+offsetX+query);
   	}else{
   	    displayWin =window.open(url,"win2","status=no,width="+width+",height="+height+",top="+offsetY+",left="+offsetX+query);
   	}
}

//function for forcing form submission
function checkEnter(e) {
    var characterCode;
  	if(e && e.which) {
        e = e;
        characterCode = e.which;
   	} else {
      	e = event;
        characterCode = e.keyCode;
   	}	 
  	if(characterCode == 13) {
       	document.forms[0].submit();
        return false;
   	}
    return true;
}  