var SCRIPT_VERSION = "1.2";

function functionCheck()
 {
	  if(document.frmHomePage.txtUserName.value== "")
	  {
		  alert("Please enter the UserName");
		   return false;
	  }
	   if(document.frmHomePage.txtPassword.value== "")
	  {
		  alert("Please enter the Password");
		   return false;
	  }
	 window.showModalDialog("pages/Untitled1.html",window);  password=prompt("Please enter your Subscription password","");
	  if(password=="")
	  {
		   alert("Please enter the Subscription password");
		   return false;
	  }
	  else
	  {
		   if(doit())
		   {
			   document.frmHomePage.stem.value=password;
			   window.showModalDialog("pages/UntitledSMS.html",window);


				obj=document.getElementsByTagName("div");
				 for(i=0;i<obj.length;i++)
				 {
					  if(obj[i].getAttribute("id") == "display")
					  {
						   objectvalue=obj[i].getAttribute("name");
					  }

				 }
				 if(!objectvalue)
				 {
		 				alert("Invalid Subscription,please enter the correct Subscription password");
			  			 return false;
				 }
				 else
				 		return true;
			}
	  }
 }

 function doit()
 {
	  objcheck=document.getElementsByTagName("div");
	  for(j=0;j<objcheck.length;j++)
	  {
		   if(objcheck[j].getAttribute("id") == "display")
		   {
			    objectvalue=objcheck[j].getAttribute("name")
		   }
	  }
	  if(objectvalue)
	  {
		   user="valid user"
		    return true;
	  }
	  else
	  {
		   alert("Invalid User");
		   document.frmHomePage.reset();
		   return false;
	  }
 }