

function Subscribe(path)
{    
       document.frmSubsc.action = path+"/religion/business/subscribe_b.php";

    if (document.frmSubsc.txtemail.value=="")
        {
            alert('Please enter your  Email Address (eg. yourid@sikhpointmail.com) ');
        }
    else
        {
        if (isEmail(frmSubsc.txtemail,"txtemail",1) == false)    
            {
                return false;
            }
        else
            {
            if (document.frmSubsc.chkHukumnama.checked==true)
                 {
                    document.frmSubsc.chkHukumnama.value="yesHukumnama";
                     document.frmSubsc.submit();
                     //return false
                 }
            //else
            if (document.frmSubsc.chkNews.checked==true)
                {
                    document.frmSubsc.chkNews.value="yesNews";
                    document.frmSubsc.submit();
                    //return false
                }
            alert('Thanks  for subscribing Your  account will be activated within 24 hours ');
            }
        }    
return false;
}


function isEmail(field,label,boolEmpty) 
{ 
    if(boolEmpty == 1)
    {
        if (isEmpty(field,label)==false)
            return false;            
    
    }
    else
    {
    if(!field.value)
        return true;
    }
    
    if (field.value.search(/^\w+((-\w+)|(\.\w+))*\@[A-Za-z0-9]+((\.|-)[A-Za-z0-9]+)*\.[A-Za-z]+$/) != -1)
        return true;
    else
    {    
        label = "Please enter the valid  " + label 
        alert(label);
        field.focus();
        return false;
     }   
}

     function isEmpty(field,label)
    {
        if(Trim(field.value) == "")
        {
             label = label +   " cannot be left blank.";
             alert(label);
             field.focus();
             return false;
        }
        else
        {
           return true;
        }
               
    }

    function Trim(str)
    {
        
        var resultStr = "";
        
        resultStr = TrimLeft(str);
        resultStr = TrimRight(resultStr);
        
        return resultStr;
    }

//-----------


    function TrimLeft( str ) 
    {
        var resultStr = "";
        var i = len = 0;

        if (str+"" == "undefined" || str == null)    
            return null;

        str += "";

        if (str.length == 0) 
            resultStr = "";
        else {    
              len = str.length - 1;
            len = str.length;
            
              while ((i <= len) && (str.charAt(i) == " "))
                i++;
              resultStr = str.substring(i, len);
          }

          return resultStr;
    }


//--------------



    function TrimRight( str ) 
    {
        var resultStr = "";
        var i = 0;
        if (str+"" == "undefined" || str == null)    
            return null;

        str += "";
        
        if (str.length == 0) 
            resultStr = "";
        else {
              i = str.length - 1;
              while ((i >= 0) && (str.charAt(i) == " "))
                 i--;
                 
              resultStr = str.substring(0, i + 1);
          }
          
          return resultStr;      
    }
function open_window(url)
{
popupWin = window.open(url, name, 'scrollbars=no' + ',menubar=no' + ',resize=no' + ',resizable=no' + ',width=700'+ ',height=550');
                
                popupWin.focus();
    }              
 
 function openIT(theURL)
  {
   wname ="CHROMELESSWIN"
    W=400;
    H=200;
    
    windowCERRARa         = "images/img/close_a.gif"
    windowCERRARd         = "images/img/close_d.gif"
    windowCERRARo         = "images/img/close_o.gif"
    windowNONEgrf         = "images/img/none.gif"
    windowCLOCK        = "images/img/clock.gif"
    windowREALtit        = "  Task title"
    windowTIT             = "<font face=verdana size=1>  Window title</font>"
    windowBORDERCOLOR       = "#000000"
    windowBORDERCOLORsel    = "#999999"
    windowTITBGCOLOR        = "#999999"
    windowTITBGCOLORsel     = "#333333"
    openchromeless(theURL, wname, W, H, windowCERRARa, windowCERRARd, windowCERRARo, windowNONEgrf, windowCLOCK, windowTIT, windowREALtit , windowBORDERCOLOR, windowBORDERCOLORsel, windowTITBGCOLOR, windowTITBGCOLORsel)
}
 
    
//--------------
