// JavaScript Document


function opennewsletter(url,ctl){
	emailwindow=dhtmlmodal.open('EmailBox', 'iframe', 'askpassword.htm', 'Authorization', 'width=600px,height=250px,center=1,resize=0,scrolling=1')
	
	emailwindow.onclose=function(){ //Define custom code to run when window is closed
	var theform=this.contentDoc.forms[0] //Access first form inside iframe just for your reference
	var theuser=this.contentDoc.getElementById("txtUser") //Access form field with id="emailfield" inside iframe
	var thepass=this.contentDoc.getElementById("txtPass") //Access form field with id="emailfield" inside iframe
	
	if (theuser.value == "demo" && thepass.value == "demome")
		{
			window.open(url);
			//ctl.target= "_blank";
			return true;
			
		}
		else
		{
			alert("Sorry your username or password is wrong.");
			return false;
		}	
	
}
} //End 

//function AskQuestion(url, ctl)
//{
//	var rv = new Array(0,0);
//	rv = window.showModalDialog("askpassword.htm" ,"Authorization","dialogWidth:600px;dialogHeight:250px;help:0;status:yes");
//	if (rv != null)
//	{
//		if (rv[0] == "demo" && rv[1] == "demome")
//		{
//			ctl.href = url;
//			ctl.target= "_blank";
//			
//		}
//		else
//		{
//			alert("Sorry your username or password is wrong.");
//			return false;
//		}	
//	}
//	else
//		return false;
//}
//
//function PassAnswer(theUser, thePass)
//{
//	var ret = new Array(theUser, thePass);
//	window.returnValue = ret;
//	window.close();
//}

	
