  var addthis_pub = "greatlocaloffers";     
  var addthis_config = {
     ui_cobrand: "Great Local Offers",
     ui_header_color: "#0083C8",
     services_exclude: "email,print",
     services_compact: "facebook,twitter,delicious,digg,google,gabbr,hotmail,linkedin,live,netlog",
     services_expanded: "facebook,twitter,delicious,digg,google,gabbr,hotmail,linkedin,live,netlog"
  }  

	function mOver(tdId,bgColour){
		if(document.getElementById){
			document.getElementById(tdId).style.backgroundColor = bgColour;}
		else if(document.all){
			document.all.item(tdId).style.backgroundColor = bgColour;}
		}

	function mOut(tdId,bgColour){
		if(document.getElementById){
			document.getElementById(tdId).style.backgroundColor = bgColour;}
		else if(document.all){
			document.all.item(tdId).style.backgroundColor = bgColour;}
		}

	function left(str, n){
		if (n <= 0)
		    return "";
		else if (n > String(str).length)
		    return str;
		else
		    return String(str).substring(0,n);
	}

	function new_Window(url,w,h) {
	  window.open(url, 'details', 'left=250,top=175,width=' + w + ',height=' + h + ',status,scrollbars').focus();
	}
	
  function Logout(){
  	confirmed = confirm("Are you sure you want to log out?")
  	if (confirmed == true) //if user hits ok in confirm box, redirect to url below	
  		location='page.asp?ID=14'//aspfile that end sessions and redirects user to index
	}

	function printpage() {
	window.print();  
  }

  function validate_email(field){
    with (field){
      apos=value.indexOf("@");
      dotpos=value.lastIndexOf(".");
      if (apos<1||dotpos-apos<2){
        return false;
      }
      else {
        return true;
      }
    }
  }
  
  function printOffer(UID){
    window.open('/print.aspx?p='+UID);
  }
  
  function executePrint(){
    window.print();
  }  
  
  function closeWindow(){
    window.close();
  }    