/**
 * @author edsadr
 */
var fopt=0;

function join(opt){
	fopt=opt;
	var dialogsec=document.getElementById("dialogs");
	if(document.getElementById("joind")==null){
		var content='<div class="ofpdialog"><fieldset style="width:280px;" id="divjoin"><legend>Joining</legend><br /><p>Read carefully before to join:<ol style="text-align:justify; padding-right:5px; font-size:10px;" class="remark"><li>You understand you are buying a membership to a DIRECTORY of Online Pharmacies.</li><li>You understand your payment is recurring until you cancel it.</li><li>You understand WE DO NOT SELL ANY meds, WE ONLY advertise online pharmacies.</li><li>You understand ALL sells are FINAL. NO REFUNDS UNDER ANY CONDITIONS.</li><li>You understand you Ip location is being saved on our database to prevent FRAUD.</li><li>You understand and Agree with our <a href="disclaimer.php" target="blank">DISCLAIMER</a>.</li></ol></p><p>&nbsp;</p><p>Please insert the email address where the login information should be sent</p><br /><p><input type="text" name="emailjoin" id="emailjoin" /></p><p>&nbsp;</p><p><a href="javascript:void(startSignup())"><img src="images/smallsignb.jpg" style="border:none; cursor: pointer;"  alt="Become a member NOW!!" /></a> &nbsp;&nbsp; <input type="image" id="joincancel" src="images/cancelb.jpg" style="border:none; cursor: pointer;" alt="cancel" /></p></fieldset></div>';
		dialogsec.innerHTML=dialogsec.innerHTML+'<div dojoType="dialog" id="joind" bgColor="#DBECF5" bgOpacity="0.7" toggle="fade" toggleDuration="600">'+content+'</div>';		
	}
	var nodeRef = document.getElementById("joind");
	dojo.widget.createWidget(nodeRef);
		
	dlg = dojo.widget.byId("joind");
	btn = document.getElementById("joincancel");
	dlg.setCloseControl(btn);
	dlg.show();
}

function startSignup(){
	var vemail=document.getElementById('emailjoin').value;
	apos=vemail.indexOf("@");
	dotpos=vemail.indexOf(".");
	if (apos<1||dotpos<1){
		alert('please insert a valid email');
		document.getElementById('emailjoin').value="";
		document.getElementById('emailjoin').focus();
		return;
	}
	
	if (fopt == 28) {
		//document.getElementById('emailid28').value=vemail;
		//document.getElementById('wemail28').value=vemail;
		document.getElementById('form28').submit();
	}
	else{
		//document.getElementById('emailid54').value=vemail;
		//document.getElementById('wemail54').value=vemail;
		document.getElementById('form54').submit();
	}
}
