
/* Description : Post between Frames */
function fnPostBackBetweenFrames(postBackFormString, frameName, actionUrl)
{
	var postBackForm = eval(postBackFormString);
	postBackForm.target = frameName;
	postBackForm.action = actionUrl;
	postBackForm.__VIEWSTATE.name = '';
	postBackForm.method = "post";
	postBackForm.submit();

	return false;
}

/* Description : Post between Pages */
function fnPostBackBetweenPages(postBackFormString,windowName, actionUrl, vWidth, vHeight)
{
	var postBackForm = eval(postBackFormString);
	// Without a target property, a page will be posted from current page to "actionUrl" page.
	var wForm = ViewCenterPop("about:blank", windowName, vWidth, vHeight, 'no', 'no', 'no', 'no', 'no');
	postBackForm.target = windowName;
	postBackForm.action = actionUrl;
	// if you want to pass the "__VIEWSTATE" value to other page, give your favorite name to a name property.
	postBackForm.__VIEWSTATE.name = '';
	window.resizeBy(+100,+100);
	postBackForm.method = "post";
	postBackForm.submit();

	return false;
}

/* Description : Post into Popup Page */
function fnPostBackPopUp(postBackFormString, windowName, actionUrl, vWidth, vHeight)
{
	var postBackForm = eval(postBackFormString);
	var wForm = ViewCenterPop("about:blank", windowName, vWidth, vHeight, 'no', 'no', 'no', 'no', 'no');
	postBackForm.target = windowName;
	postBackForm.action = actionUrl;
	postBackForm.__VIEWSTATE.name = '';
	postBackForm.method = "post";
	postBackForm.submit();
	wForm.focus();
	
	return false;
}

/* Description : Locate Popup page to center. */
function ViewCenterPop(url, pn, w, h, s, r, tb, mb, st)
{
	window.status = '';
	var winleft = (screen.width - w) / 2;
	var wintop = (screen.height - h) / 2; 

	var wForm = window.open(url,pn,'toolbar='+tb+',menubar='+mb+',scrollbars='+s+',top='+wintop+',left='+winleft+',width='+w+',height='+h+',status=yes,resizable='+r+'');

	return wForm;
}


//window.onload = initWindows;

function initWindows() {
     if (document.getElementById("childField"))
     
      {
        document.getElementById("childField"). onchange = updateParent;
        
     }
     else {
        newWindow = window.open("PopupPage.aspx", "newWin","status=yes,width=300, height=300");
     }
}

function updateParent() 
{
     opener.document.getElementById("msgLine"). value = "Hello " + this.value + "!";         
}

function checkEmail() 
{
    if (/^\w+([\.-]?\w+)*@\w+([\.-]?\w+)*(\.\w{2,3})+$/.test(document.getElementById("txtNewsEMail").value))
    {
        window.location.href = "Thankyou1.aspx?EMail=" + document.getElementById("txtNewsEMail").value; 
        return (true)
    }
    alert("Invalid E-mail Address! Please re-enter.")
    return (false)
}

function checkEmailID(ID) 
{   
    var mytool_array=ID.split(",");
    var ptr="";
    var i;
    for (i=0;i<mytool_array.length;i++)
    {   
        if (/^\w+([\.-]?\w+)*@\w+([\.-]?\w+)*(\.\w{2,3})+$/.test(document.getElementById(mytool_array[i]).value))
        {           
            
              ptr="";     
        }
        else
        {
            ptr=document.getElementById(mytool_array[i]);
            break;
        }
    }
    if (ptr!="")
    {
        alert("Invalid E-mail Address format! Please re-enter.")
        ptr.focus();
        return (false)
    }
    else
    {
        return (true)
    }
}

function checkEmailID1(ID) 
{  
    var mytool_array=ID.split(",");   
     
    if (document.getElementById(mytool_array[0]).value != document.getElementById(mytool_array[1]).value)
    {
        alert("EMail & Confirm EMail Address must be same");
        return (false)        
    }    
    return (true)    
}

function checkKeepPosted(ID)
{
    if (checkEmailID(ID)==true)
    {       
       if (checkEmailID1(ID)==true)
       {
           return (true)
       }
       else
       {
          return (false)        
       }
    }
    return (false)        
}