
function openTellAFriendForm()
{ 
    wnd = window.open("TellaFriendForm.aspx", '', 
        'width=575, height=390, resizable=no, scrollbars=no, toolbar=no, location=no, directories=no, statusbar=no, menubar=no, copyhistory=no');
    
    window.onfocus = myfunc; 
    function myfunc() { if (wnd) { if (!wnd.closed) { wnd.close();} else { wnd = null; } } }
}


function openContactUsForm()
{ 
    wnd = window.open("ContactUsForm.aspx", '', 
        'width=575, height=390, resizable=no, scrollbars=no, toolbar=no, location=no, directories=no, statusbar=no, menubar=no, copyhistory=no');
    
    window.onfocus = myfunc; 
    function myfunc() { if (wnd) { if (!wnd.closed) { wnd.close();} else { wnd = null; } } }
}


function openSupportForm()
{ 
    wnd = window.open("SupportForm.aspx", '', 
        'width=575, height=390, resizable=no, scrollbars=no, toolbar=no, location=no, directories=no, statusbar=no, menubar=no, copyhistory=no');
    
    window.onfocus = myfunc; 
    function myfunc() { if (wnd) { if (!wnd.closed) { wnd.close();} else { wnd = null; } } }
}


function ClientSideIncludeContactUs()
{ 
	clientSideInclude("ContactUsForm", "ContactUsForm.aspx");
}
function ClientSideIncludePrivacy()
{
	clientSideInclude("PrivacyForm", "PrivacyForm.aspx");
}
function ClientSideIncludeSubscriptions()
{
	clientSideInclude("SubscriptionsForm", "SubscriptionsForm.aspx");
}
function ClientSideIncludeSupport()
{
	clientSideInclude("SupportForm", "SupportForm.aspx");
}
function ClientSideIncludeTellaFriend()
{
	clientSideInclude("TellaFriendForm", "TellaFriendForm.aspx");
}

function clientSideInclude(id, url) {
//setCookie(cookieName, url);

  var req = false;
  // For Safari, Firefox, and other non-MS browsers
  if (window.XMLHttpRequest) {
    try {
      req = new XMLHttpRequest();
    } catch (e) {
      req = false;
    }
  } else if (window.ActiveXObject) {
    // For Internet Explorer on Windows
    try {
      req = new ActiveXObject("Msxml2.XMLHTTP");
    } catch (e) {
      try {
        req = new ActiveXObject("Microsoft.XMLHTTP");
      } catch (e) {
        req = false;
      }
    }
  }
 var element = document.getElementById(id);
 if (!element) {
  alert("Bad id " + id + 
   "passed to clientSideInclude." +
   "You need a div or span element " +
   "with this id in your page.");
  return;
 }
  if (req) {
    // Synchronous request, wait till we have it all
    req.open('GET', url, false);
    req.send(null);
    element.innerHTML = req.responseText;
  } else {
    element.innerHTML =
   "Sorry, your browser does not support " +
      "XMLHTTPRequest objects. This page requires " +
      "Internet Explorer 5 or better for Windows, " +
      "or Firefox for any system, or Safari. Other " +
      "compatible browsers may also exist.";
  }
}


function setCookie(name, value) {
alert(value);
  var curCookie = name + "=" + escape(value);
  document.cookie = curCookie;
  alert('curCookie' + curCookie);
}

function getCookie(name) {
  var dc = document.cookie;
  var prefix = name + "=";
  var begin = dc.indexOf("; " + prefix);
  if (begin == -1) {
    begin = dc.indexOf(prefix);
    if (begin != 0) return null;
  } else
    begin += 2;
  var end = document.cookie.indexOf(";", begin);
  if (end == -1)
    end = dc.length;
    alert(dc);
  return unescape(dc.substring(begin + prefix.length, end));
}

function ValidEmail(src) {
    var email = document.getElementById(src).value;
    if (email != '') {
        var emailReg = "^([a-zA-Z0-9])(([\-.]|[_]+)?([a-zA-Z0-9]+))*(@){1}[a-z0-9]+[.]{1}(([a-z]{2,3})|([a-z]{2,3}[.]{1}[a-z]{2,3}))$";
        var regex = new RegExp(emailReg);
        if (regex.test(email))
            return true;
        else {
            alert('Enter valid Email');
            return false;
        }
    }
}

