function openScript(url, width, height){
	var Win = window.open(url,"openScript",'width=' + width + ',height=' + height + ',resizable=1,scrollbars=yes,menubar=no,status=yes' );
}

//
var flag=false;


function DrawImageNew(ImgD,w,h){

	var image = new Image();
	image.src = ImgD.src;
	image.height = ImgD.height ;
	image.width = ImgD.width;
	
	
	
	if(image.width>0 && image.height>0){
	
	flag=true;
	
	

	if(image.width/image.height>= w/h){
	if(image.width>w)
	{ 
		ImgD.width= w;
		ImgD.height=(image.height*w)/image.width;
	}else{
		ImgD.width=image.width; 
		ImgD.height=image.height;
		}
}
else{
	if(image.height>h){ 
	ImgD.height=h;
	ImgD.width=(image.width*h)/image.height; 
}else{
	ImgD.width=image.width; 
	ImgD.height=image.height;
}
}
}

} 



function isValidEmail(strMail)
{
	var nLen = strMail.length;
	var nPos = strMail.indexOf("@");
	if (nPos==-1 || nPos==0 || nPos==nLen-1)
		return false;
	var ary = strMail.split("@");
	if (ary.length>2)
		return false;
	var nLen = ary[1].length;
	var nPos = ary[1].indexOf(".");
	if (nPos==-1 || nPos==0 || nPos==nLen-1)
		return false;
	return true;
}



var fieldstocheck = new Array();
    fieldnames = new Array();

function checkform(formname) {
var documentform = "document." + formname;
  for (i=0;i<fieldstocheck.length;i++) {
    if (eval(documentform + ".elements['"+fieldstocheck[i]+"'].value") == "") {
      alert("Please enter :"+fieldnames[i]);
      eval(documentform + ".elements['"+fieldstocheck[i]+"'].focus()");
      return false;
    }
  }

  return true;
}


function addFieldToCheck(value,name) {
  fieldstocheck[fieldstocheck.length] = value;
  fieldnames[fieldnames.length] = name;
}



