function SizablePopupWindow(URL, width, height) {
//day = new Date();
//id = day.getTime();
//eval("page" + id + " = window.open(URL, '" + id + "', 'toolbar=0,scrollbars=1,location=0,statusbar=0,menubar=0,resizable=0,width="+width+",height="+height+"');");
  newwindow=window.open(URL,'name','height='+height+',width='+width+',scrollbars=yes');
	if (window.focus) {newwindow.focus()}
	return false;

}
function toggleDiv(link, divId) {
  //alert(link);
	if(link != "javascript:void(0);"){
	  link = getObject(link);
	}
  var lText = link.innerHTML; 
	var d = getObject(divId);
 	var cur_dis = d.style.display;
	if(cur_dis == "none"){
	   d.style.display = 'block';
		// link.innerHTML = '<img src="images/cat_minus.gif" width="11" height="11" alt="[-] " />Hide Videos';
		 link.innerHTML = '[-]>Hide Videos';
	}else{
	   d.style.display = 'none';
		// link.innerHTML = '<img src="images/cat_plus.gif" width="11" height="11" alt="[+] " />Show Videos';
		 link.innerHTML = '[+]Show Videos';
	}
	
	
}//end toggle




var ie4 = false; 
if(document.all) { 
	ie4 = true; 
}
function getObject(id) 
{ 
	if (ie4) { 
		return document.all[id]; 
	} else { 
		return document.getElementById(id); 
	} 
}
function numbersonly(myfield, e, dec){
  var key;
  var keychar;
  if (window.event)
   key = window.event.keyCode;
  else if (e)
   key = e.which;
  else
   return true;
  keychar = String.fromCharCode(key);
// control keys
  if ((key==null) || (key==0) || (key==8) || 
    (key==9) || (key==13) || (key==27) )
    return true;
// numbers
  else if ((("0123456789").indexOf(keychar) > -1))
    return true;
// decimal point jump
  else if (dec && (keychar == ".")) {
   myfield.form.elements[dec].focus();
   return false;
  }
 else
  return false;
}
function EmailValidator(emailFieldId) {
    email = p2 = getObject(emailFieldId);
		str = email.value;
		var at="@";
		var dot=".";
		var lat=str.indexOf(at);
		var lstr=str.length;
		var ldot=str.indexOf(dot);
		if (str.indexOf(at)==-1){
		   alert("Invalid E-mail Address");
		   return false;
		}

		if (str.indexOf(at)==-1 || str.indexOf(at)==0 || str.indexOf(at)==lstr){
		   alert("Invalid E-mail Address")
		   return false
		}

		if (str.indexOf(dot)==-1 || str.indexOf(dot)==0 || str.indexOf(dot)==lstr){
		    alert("Invalid E-mail Address")
		    return false
		}

		 if (str.indexOf(at,(lat+1))!=-1){
		    alert("Invalid E-mail Address")
		    return false
		 }

		 if (str.substring(lat-1,lat)==dot || str.substring(lat+1,lat+2)==dot){
		    alert("Invalid E-mail Address")
		    return false
		 }

		 if (str.indexOf(dot,(lat+2))==-1){
		    alert("Invalid E-mail Address")
		    return false
		 }
		
		 if (str.indexOf(" ")!=-1){
		    alert("Invalid E-mail Address")
		    return false
		 }

 		 return true					
	}

