var g_sampleEmail = 'Example: yourEmail@domain.com.au';

function ClearEmailTextBox()

{

	//alert('hello');

  var txtEmail =document.getElementById('txtEmail');

  if (g_sampleEmail == txtEmail.value)

    txtEmail.value = '';

  txtEmail.className = 'textboxnewsleetergrey';

}

function SetEmailTextBox()

{

  var txtEmail =document.getElementById('txtEmail');

  if (g_sampleEmail == txtEmail.value)

    txtEmail.className = 'textboxnewsleetergrey';

  else

    txtEmail.className = 'textboxnewsleetergrey';

}



                   function StringLengthValidatorEvaluateIsValid(val) {

                       var value =ValidatorGetValue(val.controltovalidate);

                       if (val.allowwhitespaceonly != "t")

                       {

                           value= value.replace(/\s+/g, "");

                       }

                       if (val.isvalueoptional == "t")

                       {

                           tmpval = value.replace(/\s+/g, "");

                           if (tmpval.length == 0)

                               return true;

                       }

                       if ( val.maxlength != null)

                           return ((value.length >= val.minlength) &&

(value.length <= val.maxlength));

                       else 

                           return (value.length >= val.minlength);

                       }

 function isLogin(strURL,url) {

//alert(strURL);

    var xmlHttpReq = false;

    var self = this;

	// Mozilla/Safari

    if (window.XMLHttpRequest) {

        self.xmlHttpReq = new XMLHttpRequest();

    }

    // IE

    else if (window.ActiveXObject) {

        self.xmlHttpReq = new ActiveXObject("Microsoft.XMLHTTP");

    }

	

    self.xmlHttpReq.open('GET', strURL+"?to="+url, true);

    self.xmlHttpReq.setRequestHeader('Content-Type', 'application/x-www-form-urlencoded');

    self.xmlHttpReq.onreadystatechange = function() {

        if (self.xmlHttpReq.readyState == 4) 

		{
 
				if(self.xmlHttpReq.responseText=="1")

				{

					url=url.replace(/\!/g,"?");

					url=url.replace(/\-/g,"=");

					url=url.replace(/\|/g,"&");

					window.location.href=url;

				}

				else

				{

						//alert('Please Login/Register to access it');

						window.location.href="../about/member_register.php?msg=You must be logged in to access that page";

				}

    	}

	}

    self.xmlHttpReq.send('');

}



function isLogin_newsletter(strURL,url) {

//alert(strURL);

    var xmlHttpReq = false;

    var self = this;

	// Mozilla/Safari

    if (window.XMLHttpRequest) {

        self.xmlHttpReq = new XMLHttpRequest();

    }

    // IE

    else if (window.ActiveXObject) {

        self.xmlHttpReq = new ActiveXObject("Microsoft.XMLHTTP");

    }

	

    self.xmlHttpReq.open('GET', strURL+"?to="+url, true);

    self.xmlHttpReq.setRequestHeader('Content-Type', 'application/x-www-form-urlencoded');

    self.xmlHttpReq.onreadystatechange = function() {

        if (self.xmlHttpReq.readyState == 4) 

		{

				if(self.xmlHttpReq.responseText=="1")

				{

					url=url.replace(/\!/g,"?");

					url=url.replace(/\-/g,"=");

					url=url.replace(/\|/g,"&");

					window.location.href=url;

				}

				else

				{

						//alert('Please Login/Register to access it');

						window.location.href="../../about/member_register.php?msg=You must be logged in to access that page";

				}

    	}

	}

    self.xmlHttpReq.send('');

}



