function getDocHeight(doc) {
  var docHt = 0, sh, oh;
  if (doc.height) docHt = doc.height;
  else if (doc.body) {
    if (doc.body.scrollHeight) docHt = sh = doc.body.scrollHeight;
    if (doc.body.offsetHeight) docHt = oh = doc.body.offsetHeight;
    if (sh && oh) docHt = Math.max(sh, oh);
  }
  return docHt;
}

window.onbeforeprint=function ()
{
/*
if (document.all) 
  { 
  document.mapRestaurant.focus(); 
  document.mapRestaurant.print(); 
  window.print();
  } 
else 
  { 
  window.frames["mapRestaurant"].focus(); 
  window.frames["mapRestaurant"].print(); 
  }
*/
}

var req;

function loadXMLDoc(url) {
	req = false;
    // branch for native XMLHttpRequest object
    if(window.XMLHttpRequest && !(window.ActiveXObject)) {
    	try {
			req = new XMLHttpRequest();
        } catch(e) {
			req = false;
        }
    // branch for IE/Windows ActiveX version
    } else if(window.ActiveXObject) {
       	try {
        	req = new ActiveXObject("Msxml2.XMLHTTP");
      	} catch(e) {
        	try {
          		req = new ActiveXObject("Microsoft.XMLHTTP");
        	} catch(e) {
          		req = false;
        	}
		}
    }
	if(req) {
		req.onreadystatechange = processReqChange;
		req.open("GET", url, true);
		req.send("");
		
	}
}

function processReqChange() {
    // only if req shows "loaded"
    if (req.readyState == 4) {
        // only if "OK"

        if (req.status == 200) {
	        	       		
       		  document.getElementById("divCounter").innerHTML="<span class='hyperlinkPrivacyPolicy'> Visits: "+req.responseText+"</span>";
            // ...processing statements go here...
        } else {
            //alert("There was a problem retrieving the XML data:\n" + req.statusText);
        }
        
	//alert(req.responseText);
         
    }
}



	function changecolor1()
		{
		
			document.getElementById('imagewrapperTD').className="changecolor1";
		}
		
		function changecolor2()
		{
		
			document.getElementById('imagewrapperTD').className="changecolor1";
		}
		
		

var setGradient = (function(){

//private variables;
var p_dCanvas = document.createElement('canvas');
var p_useCanvas = !!( typeof(p_dCanvas.getContext) == 'function');
var p_dCtx = p_useCanvas?p_dCanvas.getContext('2d'):null;
var p_isIE = /*@cc_on!@*/false;


//test if toDataURL() is supported by Canvas since Safari may not support it

try{ p_dCtx.canvas.toDataURL() }catch(err){
p_useCanvas = false ;
};

if(p_useCanvas){

return function (dEl , sColor1 , sColor2 , bRepeatY ){

if(sColor1 == sColor2)
{
//alert(sColor1);
document.body.bgColor =sColor1 ;
}

if(typeof(dEl) == 'string')
{
	if(dEl=='tdBodyGradiant')
	{
	dEl='DivLoaded';
	document.getElementById('DivLoaded').style.height= getDocHeight(document);
	}	


 dEl = document.getElementById(dEl);
}
if(!dEl) return false;
var nW = dEl.offsetWidth;
var nH = dEl.offsetHeight;
p_dCanvas.width = nW;
p_dCanvas.height = nH;


var dGradient;
var sRepeat;
// Create gradients
if(bRepeatY){
dGradient = p_dCtx.createLinearGradient(0,0,nW,0);
sRepeat = 'repeat-y';
}else{
dGradient = p_dCtx.createLinearGradient(0,0,0,nH);
sRepeat = 'repeat-x';
} 

dGradient.addColorStop(1,sColor1);
dGradient.addColorStop(0,sColor2); 

p_dCtx.fillStyle = dGradient ; 
p_dCtx.fillRect(0,0,nW,nH);
var sDataUrl = p_dCtx.canvas.toDataURL('image/png');

with(dEl.style){
backgroundRepeat = sRepeat;
backgroundImage = 'url(' + sDataUrl + ')';
backgroundColor = sColor2; 
};
}
}else if(p_isIE){

p_dCanvas = p_useCanvas = p_dCtx = null; 
return function (dEl , sColor1 , sColor2 , bRepeatY){

if(typeof(dEl) == 'string')
{
if(dEl=='tdBodyGradiant')
	{
	dEl='DivLoaded';
	document.getElementById('DivLoaded').style.height= getDocHeight(document);
	}
 dEl = document.getElementById(dEl);
}
if(!dEl) return false;
dEl.style.zoom = 1;
var sF = dEl.currentStyle.filter;
dEl.style.filter += ' ' + ['progid:DXImageTransform.Microsoft.gradient( GradientType=', +(!!bRepeatY ),',enabled=true,startColorstr=',sColor2,', endColorstr=',sColor1,')'].join('');

};

}else{

p_dCanvas = p_useCanvas = p_dCtx = null;
return function(dEl , sColor1 , sColor2 ){

if(typeof(dEl) == 'string')
{
if(dEl=='tdBodyGradiant')
	{
	dEl='DivLoaded';
	document.getElementById('DivLoaded').style.height= getDocHeight(document);
	}
 dEl = document.getElementById(dEl);
}
if(!dEl) return false;
with(dEl.style){
backgroundColor = sColor2; 
};
//alert('your browser does not support gradient effet');
}
}
})();









	
	function showhideloadimageroot()
		{

			if (document.images) 
				document.ProgBar.src='Images/Spacer.gif';			
			document.getElementById('loadtext').style.display='none';


		}


function ResizeIframe()
		{
		setIframeHeight("iframePreview");
		
				
		}
		
		function getDocHeight(doc) {
  var docHt = 0, sh, oh;
  if (doc.height) docHt = doc.height;
  else if (doc.body) {
    if (doc.body.scrollHeight) docHt = sh = doc.body.scrollHeight;
    if (doc.body.offsetHeight) docHt = oh = doc.body.offsetHeight;
    if (sh && oh) docHt = Math.max(sh, oh);
  }
  return docHt;
}
 
function setIframeHeight(iframeName) 
   {
   
   if( window.parent.frames[iframeName]!=null)
     {
    
     var iframeWin = window.parent.frames[iframeName];
    
     var iframeEl = document.getElementById? window.parent.document.getElementById(iframeName): window.parent.document.all? window.parent.document.all[iframeName]: null;
   
     if ( iframeEl && iframeWin ) 
        {
        
        iframeEl.style.height = "auto"; // helps resize (for some) if new doc shorter than previous  
        var docHt = getDocHeight(iframeWin.document);
        // need to add to height to be sure it will all show
        if (docHt) 
             {
            
             iframeEl.style.height = (docHt + 900) + "px";
             }
        }
     }
   }
 
function loadIframe(iframeName, url) {
  if ( window.frames[iframeName] ) {
    window.frames[iframeName].location = url;   
    return false;
  }
  else return true;
}

 function SetSRC()
 {
 
//  loadXMLDoc2('http://'+document.domain+'/GetVisiteAlert.aspx?RestaurantInfoID='+document.getElementById('hdnRestaurantInfoID').value);
  
  if(document.getElementById('divCounter')!= null)
  {


  loadXMLDoc('http://'+document.domain+'/GetVisiteCount.aspx?RestaurantInfoID='+document.getElementById('hdnRestaurantInfoID').value);
  }
 
/*
if( document.getElementById('divContainer')!=null)
{ 
if(document.all)
	 {
	 document.getElementById('divContainer').style.height="410px";
	// document.write("<style>#divContainer {	height:410px;}</style>");
	 }
	 else
	 {
 	 document.getElementById('divContainer').style.minHeight="410px";
	 //document.write("<style>#divContainer {	min-height:410px;}</style>");
	 }
}	*/ 
  if(document.getElementById('IframePhoto')!=null)
   {
 
   var abc=document.getElementById('IframePhoto');
   
    var RestaurantInfoID=document.getElementById('hdnRestaurantInfoID').value;
   
    //abc.src="http://"+document.domain+"/BusinessDetails/RestaurantImageBlistNew.aspx?RestaurantInfoID="+RestaurantInfoID;   
  abc.src=abc.src;

  }

 if(document.getElementById('mapRestaurant')!=null)
	   {
	     
		      var src= document.getElementById('hdnMapSrc').value;
		    //alert(src);
		    
		    if((document.domain=="www.premiumlocallisting.com")||(document.domain=="www.premiumlocallistings.com")||(document.domain=="www.pll411.com"))
		    {
		    document.getElementById('mapRestaurant').src=src;//.replace('business/','http://'+document.domain+'/business/');
		    }
		    else
		    {
		    document.getElementById('mapRestaurant').src=src;//.replace('../','http://www.premiumlocallisting.com/');
		    }
		    
		    
		    document.getElementById('mapRestaurant').style.display='block';
	    }  
}

function initArray() {
    this.length = initArray.arguments.length;
    for (var i = 0; i < this.length; i++)
        this[i] = initArray.arguments[i];
}

		function from10toradix(value,radix){
    var retval = '';
    var ConvArray = new initArray(0,1,2,3,4,5,6,7,8,9,'A','B','C','D','E','F');
    var intnum;
    var tmpnum;
    var i = 0;

    intnum = parseInt(value,10);
    if (isNaN(intnum)){
        retval = 'NaN';
    }else{
        if (intnum < 1){
            retval ="0";
        }else{
            retval = "";
        }
        while (intnum > 0.9){
            i++;
            tmpnum = intnum;
            // cancatinate return string with new digit:
            retval = ConvArray[tmpnum % radix] + retval;  
            intnum = Math.floor(tmpnum / radix);
            if (i > 100){
                // break infinite loops
                retval = 'NaN';
                break;
            }
        }
    }
    return retval;
}

		function GetLightColor(DarkColor,Ratio)
		{
		DarkColor=new String(DarkColor);
			//var =1.5;
			
			
			LightColor =new String('');
			Red=new String('');
			Green=new String('');
			Blue=new String('');
			
			DarkColor=DarkColor.replace('#','');

			if(DarkColor.length==6)
			{
				Red=DarkColor.substring(0,2);
				Green=DarkColor.substring(2,4);
				Blue=DarkColor.substring(4,6);
			
			
				iRed=parseInt(parseFloat(parseInt(Red,16)) * Ratio);

				iGreen=parseInt(parseFloat(parseInt(Green,16)) * Ratio); 
				iBlue=parseInt(parseFloat(parseInt(Blue,16)) * Ratio); 

				if(iRed>255 ||iGreen>255||iBlue>255)
				{
					iRed=255;
					iGreen=255;
					iBlue=255;
					if(Ratio==1.5)
					{
						
						GetLightColor(DarkColor,0.8);
					}
				}

				Red=from10toradix(iRed, 16); 
			
				Green=from10toradix(iGreen, 16);
				Blue=from10toradix(iBlue, 16);

				if(Red.length==1)
				{
					Red="0"+Red;
				}
				if(Green.length==1)
				{
					Green="0"+Green;
				}
				if(Blue.length==1)
				{
					Blue="0"+Blue;
				}


				LightColor="#"+Red+Green+Blue;
			}

			return LightColor;
		}		    
 function AddCss()
    {
   

    SetSRC();
  
ResizeIframe();

  

  
  
    if (document.images) 
				document.ProgBar.src='Images/Spacer.gif';			
	document.getElementById('loadtext').style.display='none';
	
    var hdnPath=document.getElementById('hdnpath').value;

    if(getQueryVariable("preview")==null)
	{
    var lnknew=document.createElement('LINK');
    
    document.getElementById('myhead').insertBefore(lnknew,document.getElementById('Parentlnk'));

    }
    else
    {
    
  
   
    var HeaderHeight=window.parent.document.getElementById('hdnHeaderHeight').value;
    var bgCol=window.parent.document.getElementById('hdnbg').value;
     var InnerPageBG=window.parent.document.getElementById('hdnInnerPageBG').value;
     var HeaderBottomColor=window.parent.document.getElementById('hdnHeaderBottom').value;
          var HeaderBottomHeight=window.parent.document.getElementById('hdnHeaderBottomHeight').value;
    var textCol=window.parent.document.getElementById('hdnFtrClr').value;//hdnFtrClr
    
   var ButtonBackGround=window.parent.document.getElementById('hdnButtonBackGround').value;//hdnFtrClr
    
  var obtn=window.parent.document.getElementById('rdbgrd');
    var rdbTile=window.parent.document.getElementById('rdbTile');
  var hdnImage=window.parent.document.getElementById('hdnImage');
    var strTileImagePath=window.parent.document.getElementById('hdnTileImagePath').value;

var ServiceAreaColor=window.parent.document.getElementById('hdnServiceArea').value;
var FontValue =window.parent.document.getElementById('drpFont').value;
var Font='Verdana';
if(FontValue!='0')
{
//Font = window.parent.document.getElementById('drpFont').options[FontValue].text;
Font = FontValue;
}
var FontSizeValue =window.parent.document.getElementById('drpFontSize').value;
var FontSize='8pt';
if(FontSizeValue!='0')
{
//FontSize = window.parent.document.getElementById('drpFontSize').options[FontSizeValue].text;
FontSize =FontSizeValue;
}

//setGradient("indentmenu",GetLightColor(textCol,1.5),textCol,0);
setGradient("indentmenu",GetLightColor(ButtonBackGround,1.5),ButtonBackGround,0);   
//alert(1);


//setGradient("imagewrapper",GetLightColor(textCol,1.5),textCol,0);
setGradient("imagewrapper",GetLightColor(ButtonBackGround,1.5),ButtonBackGround,0);


  
var strImageName =hdnImage.value.split("'").join("%27");
hdnImage.value =strImageName ;
//alert(hdnImage.value);

    var ss1 = document.createElement('style');
    //var def = ".bgimage {  background-image : url('Header.gif'); height:60px;	 }";
     var def =  " .hyperlinkPrivacyPolicy "+
                " { "+
				" font-family:  Arial; "+
				" font: Tahoma; "+
				" font-size: 7pt; "+
				" vertical-align: middle; "+
				" text-decoration:none; "+
				" } "+
                " .hyperlink "+
                " { "+
	            " font-family: Verdana, Arial; "+
	            " font: Tahoma; "+
	            " font-size: 8pt; "+
	            " vertical-align: middle; "+
	
                " } "+ 
                
                " .bgimage "+ 
				" {" ;
				//" background-image : url('../Headers/Header.gif');"+
				if(hdnImage.value=='Header.gif')
				{
				def +=((document.domain=="tablenow.pbhllc.com")?
				" background-image : url('http://tablenow.pbhllc.com/BusinessListing/D928BusinessListing/StyleEditor/Temp/"+hdnImage.value +"'); ":
				" background-image : url('http://tablenow.pbhllc.com/BusinessListing/D928BusinessListing/StyleEditor/Temp/newHeader.gif'); "
				)
				}
				else
				{
				def +=" background-image : url('http://tablenow.pbhllc.com/BusinessListing/D928BusinessListing/StyleEditor/Temp/"+hdnImage.value +"'); ";
				}
				
				
				def +=
				" height:"+HeaderHeight+"px;"+
				" background-repeat:no-repeat;"+
				" background-position:center;"+
				" }" +
				" .SubHeaderOrangeDay"+
				" {"+
				" font-family: Verdana,Arial;"+
				" font-size: 9pt;"+
				" font-weight:bold;"+
				" vertical-align :baseline;"+
				" color:"+textCol+";"+
				" }";
			
			if(rdbTile.checked!=true)
			{	
				def+=
				" .BodyGradiant"+
				" {";
			
			
				if(obtn.checked==true)
				{
				def+=
				" filter:progid:DXImageTransform.Microsoft.Gradient( startColorstr="+bgCol+",endColorstr=#FFFFFF);"+
				" margin-top:0px;"+
				" margin-left:5px;"+
				" margin-right:5px;"+
				" text-align:center;";
				}
				else
				{
				def+=
				" background-color:"+ bgCol + ";";
				}
				
				def+=" }"+
				" .BodyGradiant1"+
				" {";
				
				if(obtn.checked==true)
				{
				def+=
				" filter:progid:DXImageTransform.Microsoft.Gradient( startColorstr=#FFFFFF,endColorstr="+bgCol+");"+
				" margin-top:0px;"+
				" margin-left:5px;"+
				" margin-right:5px;"+
				" text-align:center;";
				}
				else
				{
				def+=
				" background-color:"+ bgCol + ";";
				}
				
				def+=
				" }";
			}
					def+=
				" .tableMain"+
				" {"+
				" border-top:gray solid 2px;"+
				" BORDER-left: gray  Solid 2px;"+
				" BORDER-right: gray  Solid 2px;"+
				" width:784px;"+
				" margin-top:0px;"+
				" margin-bottom:0px;"+
				" background-color:White;"+
				" }"+
				".labeltextBold"+
				"{"+
				"font-family: Verdana,Arial;"+
				"font-size: 12px;"+
				"vertical-align :middle;"+
				"text-align:justify;"+
				"font-weight:bold;"+
				"}"+
				".tdInside"+
				"{"+
				"font-family: Verdana,Arial;"+
				"font-size: 8pt;"+
				"vertical-align :middle;"+
				"text-align:justify;"+
				"padding-left:15px;"+
				"}"+
				".MainHeader"+
				"{"+
				"font-family: Verdana,Arial;"+
				"font-size:25px;"+
				"font-weight:bold;"+
				"height:8px;"+
				"vertical-align :middle;"+
				"color:"+textCol+";"+
				"}"+
				" h1"+
				" {"+
				" font-family: Verdana,Arial;"+
				" font-size:25px;"+
				" font-weight:bold;"+
				" height:32px;"+
				" line-height:32px;"+
				" line-width:780px;"+
				" vertical-align :baseline;"+
				" color:"+textCol+";"+
				" margin-bottom: 0;"+
				" margin-top: 0;"+
				" }"+
				".linkButton"+
				"{"+
				"font-family:Verdana;"+
				"font-size: 12px;"+
				"font-weight:bold;"+
				"text-align:center;"+
				"COLOR: "+textCol+";"+
				"VERTICAL-ALIGN: super;"+
				"}"+
				".linkButtonBig"+
				"{"+
				"font-family:Verdana;"+
				"font-size: 14px;"+
				"font-weight:bold;"+
				"text-align:center;"+
				"COLOR: "+textCol+";"+
				"VERTICAL-ALIGN: super;"+
				"}"+

				".SubHeaderBlack"+
				"{"+
				"font-family: Verdana,Arial;"+
				"font-size:small;"+
				"font-weight:bold;"+
				"vertical-align :baseline;"+
				"color:Black;"+
				"+}"+
				".dottedborder"+
				"{"+
				"border-style: dashed;"+
				"border-width: 1px;"+
				"width:97%;"+
				"}"+
				".SubHeaderOrange"+
				"{"+
				"font-family: Verdana,Arial;"+
				"font-size:16px;"+
				"font-weight:bold;"+
				"vertical-align :baseline;"+
				"color:"+textCol+";"+
				"margin-top:5px;"+
				"}"+
				".SubHeaderOrangePhoto"+
				"{"+
				"font-family: Verdana,Arial;"+
				"text-align:justify;"+
				"font-size:16px;"+
				"font-weight:bold;"+
				"vertical-align :baseline;"+
				"color:"+textCol+";"+
				"margin-top:5px;"+
				"}"+

				" h2"+
				" {"+
				" font-family: Verdana,Arial;"+
				" font-size:16px;"+
				" font-weight:bold;"+
				" line-height:20px;"+
				" vertical-align :baseline;"+
				" color:#a50053;"+
				" margin-top:5px;"+
				" margin-bottom: 0;"+
				" }"+
				".SubHeaderOrangeTime"+
				"{"+
				"font-family: Verdana,Arial;"+
				"font-size:16px;"+
				"font-weight:bold;"+
				"vertical-align :baseline;"+
				"color:"+textCol+";"+
				"margin-top:5px;"+
				"height:8px;"+
				"}"+
				".labeltext"+
				"{"+
				"font-family: Verdana,Arial;"+
				"font-size: 8pt;"+
				"vertical-align :middle;"+
				"text-align:justify;"+
				"}"+
				".labeltext"+
				"{"+
				"font-family: '"+Font+"';"+
				"font-size: "+FontSize+";"+
				"}"+
				".td"+
				"{"+
				"font-family: Verdana,Arial;"+
				"font-size: 8pt;"+
				"vertical-align :middle;"+
				"text-align:justify;"+
				"}"+
				".tdTime"+
				"{"+
				"font-family: Verdana,Arial;"+
				"font-size: 8pt;"+
				"vertical-align :middle;"+
				"}"+
				".FooterBackground"+
				"{"+
				"background-color:#EEEEEE;"+
				"width:780px;"+
				"height:30px;"+
				"}"+
				".FooterText"+
				"{"+
				"font-family: Verdana,Arial;"+
				"font-size: 8pt;"+
				"vertical-align :middle;"+
				"text-align:justify;"+
				"font-weight:bold;"+
				"color:"+textCol+";"+
				"}"+

				".PageBackground"+
				"{"+
				"background-color:Silver;"+
				"}"+
				
				
				"#imagewrapper"+
			    "{"+
				"width:344px;"+
				"position: relative;"+
				"BORDER-RIGHT: #000000 1px solid;"+
        		"BORDER-TOP: #000000 1px solid;"+
                "BORDER-LEFT: #000000 1px solid;"+
                "BORDER-BOTTOM: #000000 1px solid;"+
				"}"+

				".changecolor1"+
				"{"+
				"color:#ffffff;"+
				"font-family:'trebuchet ms',helvetica,sans-serif;"+
				"font-size:100%;"+
				"font-weight:bold;"+
				"height:28px;"+
				"vertical-align:middle;"+
				"}"+

				".changecolor2"+
				"{"+
				"color:"+ bgCol+";"+
				"font-family:'trebuchet ms',helvetica,sans-serif;"+
				"font-size:100%;"+
				"font-weight:bold;"+
				"height:28px;"+
				"vertical-align:middle;"+
				"}"+
				
				"#indentmenu"+
				"{"+
				"font: bold 13px Arial;"+
				"width: 100%;"+
				"overflow: hidden;"+
				"padding-left:0px;"+
				"}"+
				
				"#indentmenu ul"+
				"{"+
				"margin: 0;"+
				"padding: 0;"+
				"float: left;"+
				"width: 98%;"+
				"}"+
				
				"#indentmenu ul li"+
				"{"+
				"display: inline;"+
				"margin:2px;"+
				"}"+
				
				"#indentmenu ul li a"+
				"{"+
				"float: left;"+
				"color: white;"+
				"padding: 5px 11px;"+
				"text-decoration: none;"+
				"border-right: 1px solid #ffffff;"+
				"}"+
				"#indentmenu ul li a:visited"+
				"{"+
				"color: white;"+
				"}"+
				"#indentmenu ul li a:hover, .indentmenu ul li .current"+
				"{"+
				"color: white !important;"+
				"padding-top: 6px;"+
				"padding-bottom: 4px;"+
				"}"+
				"#divContainer"+
				"{"+
				"min-height:410px;"+
				"height:auto !important;"+
				"height:410px;"+
				"MARGIN-LEFT: 15px;"+
				"MARGIN-RIGHT: 15px;"+
				"FONT-SIZE: "+FontSize+";"+
				"FONT-FAMILY: '"+Font+"';"+

				"}"+
				".textboxright"+
				"{"+
				"font-weight: normal;"+
				"font-family: Verdana,Arial;"+
				"font-size: 8pt;"+
				"text-align:right;"+
				"color: #000000;	"+
				"background-color: white;"+
				"border-color: Black;"+
				"border-width: 1px;"+
				"border-style: solid;"+
				"width: 122px;"+
				"height:18px;"+
				"}"+

				".textboxcenter"+
				"{"+
				"font-weight: normal;"+
				"font-family: Verdana,Arial;"+
				"font-size: 8pt;"+
				"text-align:center;"+
				"color: #000000;	"+
				"background-color: white;"+
				"border-color: Black;"+
				"border-width: 1px;"+
				"border-style: solid;"+
				"width: 122px;"+
				"height:18px;"+
				"}"+

				".textbox"+
				"{"+
				"font-weight: normal;"+
				"font-family: Verdana,Arial;"+
				"font-size: 8pt;"+
				"color: #000000;	"+
				"background-color: white;"+
				"border-color: Black;"+
				"border-width: 1px;"+
				"border-style: solid;"+
				"width: 122px;"+
				"height:18px;"+
				"}"+

				".dropdown"+
				"{"+
				"font-weight: normal;"+
				"font-family: Verdana,Arial;"+
				"font-size: 8pt;"+
				"color: #000000;"+
				"background-color: white;"+
				"border-color: Black;"+
				"border-width: 1px;"+
				"border-style: solid;"+
				"width:122px;"+
				"}"+

				".button"+
				"{"+
				"background-color:Olive"+
				"font-family: Verdana,Arial;"+
				"font-size: 8pt;"+
				"font-weight:bold;  	"+
				"}"+
				
				".InnerPageBackGround"+
				"{"+
				"background-color: "+InnerPageBG+";"+
				"}"+
				".HeaderBottom"+
				"{"+
				" border-bottom:"+HeaderBottomColor+" solid "+HeaderBottomHeight+"px;"+
				"}"+
				".ServiceAreaColor"+
				"{"+
				" color: "+ServiceAreaColor+";"+
				"}"+
				"body"+
				"{"+
				" color: "+ServiceAreaColor+";"+
				"}"
				;
				
				if(rdbTile.checked==true)
			{	
				
			/*	"table"+
			    "{"+
			    "background-color:Transparent;"+
				"}"+
				"table td"+
			    "{"+
			    "background-color:Transparent;"+
				"}"+
			    "#tblBody td"+
			    "{"+
			    "background-color:Transparent;"+
				"}"+
				"table"+
				"{"+
				"background : url('"+strTileImagePath+"');"+
				"}"+
				"#imagewrapper table"+
			    "{"+
			    "background : url('');"+
				"}";
				*/
				def+=
				"body"+
				"{"+
				"background-image : url('"+strTileImagePath+"');"+
				"}"+
				"#tdBodyGradiant1"+
				"{"+
				"background-image : url('"+strTileImagePath+"');"+
				"}"+
				"#tdBodyGradiant2"+
				"{"+
				"background-image : url('"+strTileImagePath+"');"+
				"}";

			}	


    
    ss1.setAttribute("type", "text/css");
    
    //ss1.styleSheet.cssText = def;
    
    
    if (ss1.styleSheet) 
       {   // IE
       ss1.styleSheet.cssText = def;
       } 
   else 
       {                // the world
       var tt1 = document.createTextNode(def);
       ss1.appendChild(tt1);
       }

    
    
       
    var hh1 = document.getElementsByTagName('head')[0];
     
    hh1.appendChild(ss1);
    
    }



  
	
		    if(getQueryVariable("preview")==null)
			{
			lnknew.setAttribute('href',hdnPath+'bizmain.css');
			lnknew.setAttribute('type','text/css');
            lnknew.setAttribute('rel','stylesheet');
			}
			else
			{
			
			}
   
   
    document.getElementById('DivLoaded').style.display='block';
    document.getElementById('loadtext').style.display='none';

	if(rdbTile.checked!=true)
	{

	setGradient("DivLoaded","#FFFFFF",bgCol,0); 
	}
   
	 //for map by piyush
	 
	  
	//     DISPLAY: none


    }
/*
 function AddCss()
    {
   
        
    if (document.images) 
				document.ProgBar.src='Images/Spacer.gif';			
	document.getElementById('loadtext').style.display='none';
	
    var hdnPath=document.getElementById('hdnpath').value;

     if(getQueryVariable("preview")==null)
	{
    var lnknew=document.createElement('LINK');
    
      document.getElementById('myhead').insertBefore(lnknew,document.getElementById('Parentlnk'));

    }
    else
    {
    var bgCol=window.parent.document.getElementById('hdnbg').value;
    var textCol=window.parent.document.getElementById('hdnFtrClr').value;//hdnFtrClr
   // alert(window.parent.document.getElementById('hdnImage').Value);
    
    var ss1 = document.createElement('style');
   
     var def = " .bgimage "+ 
				" {" +
				//" background-image : url('http://tablenow.pbhllc.com/BusinessListing/D928BusinessListing/StyleEditor/TempUpload/"+window.parent.document.getElementById('hdnImage').Value +"');"+
				" background-image : url('../Headers/Header.gif');"+
				
				" height:60px;"+
				" }" +
				" .SubHeaderOrangeDay"+
				" {"+
				" font-family: Verdana,Arial;"+
				" font-size: 9pt;"+
				" font-weight:bold;"+
				" vertical-align :baseline;"+
				" color:"+textCol+";"+
				" }"+
				" .BodyGradiant"+
				" {"+
				" filter:progid:DXImageTransform.Microsoft.Gradient( startColorstr="+bgCol+",endColorstr=#FFFFFF);"+
				" margin-top:0px;"+
				" margin-left:5px;"+
				" margin-right:5px;"+
				" text-align:center;"+
				" }"+
				" .tableMain"+
				" {"+
				" border-top:gray solid 2px;"+
				" BORDER-left: gray  Solid 2px;"+
				" BORDER-right: gray  Solid 2px;"+
				" width:785px;"+
				" margin-top:0px;"+
				" margin-bottom:0px;"+
				" background-color:White;"+
				" }"+
				".labeltextBold"+
				"{"+
				"font-family: Verdana,Arial;"+
				"font-size: 12px;"+
				"vertical-align :middle;"+
				"text-align:justify;"+
				"font-weight:bold;"+
				"}"+
				".tdInside"+
				"{"+
				"font-family: Verdana,Arial;"+
				"font-size: 8pt;"+
				"vertical-align :middle;"+
				"text-align:justify;"+
				"padding-left:15px;"+
				"}"+
				".MainHeader"+
				"{"+
				"font-family: Verdana,Arial;"+
				"font-size:large;"+
				"font-weight:bold;"+
				"height:8px;"+
				"vertical-align :middle;"+
				"color:"+textCol+";"+
				"}"+
				".linkButton"+
				"{"+
				"font-family:Verdana;"+
				"font-size: 12px;"+
				"font-weight:bold;"+
				"text-align:center;"+
				"COLOR: "+textCol+";"+
				"VERTICAL-ALIGN: super;"+
				"}"+
				".linkButtonBig"+
				"{"+
				"font-family:Verdana;"+
				"font-size: 14px;"+
				"font-weight:bold;"+
				"text-align:center;"+
				"COLOR: "+textCol+";"+
				"VERTICAL-ALIGN: super;"+
				"}"+
				".SubHeaderBlack"+
				"{"+
				"font-family: Verdana,Arial;"+
				"font-size:small;"+
				"font-weight:bold;"+
				"vertical-align :baseline;"+
				"color:Black;"+
				"+}"+
				".dottedborder"+
				"{"+
				"border-style: dashed;"+
				"border-width: 1px;"+
				"width:97%;"+
				"}"+
				".SubHeaderOrange"+
				"{"+
				"font-family: Verdana,Arial;"+
				"font-size:small;"+
				"font-weight:bold;"+
				"vertical-align :baseline;"+
				"color:"+textCol+";"+
				"margin-top:5px;"+
				"}"+
				".SubHeaderOrangeTime"+
				"{"+
				"font-family: Verdana,Arial;"+
				"font-size:small;"+
				"font-weight:bold;"+
				"vertical-align :baseline;"+
				"color:"+textCol+";"+
				"margin-top:0px;"+
				"height:8px;"+
				"}"+
				".labeltext"+
				"{"+
				"font-family: Verdana,Arial;"+
				"font-size: 8pt;"+
				"vertical-align :middle;"+
				"text-align:justify;"+
				"}"+
				".td"+
				"{"+
				"font-family: Verdana,Arial;"+
				"font-size: 8pt;"+
				"vertical-align :middle;"+
				"text-align:justify;"+
				"}"+
				".FooterBackground"+
				"{"+
				"background-color:lightgrey;"+
				"width:780px;"+
				"height:30px;"+
				"}"+
				".FooterText"+
				"{"+
				"font-family: Verdana,Arial;"+
				"font-size: 8pt;"+
				"vertical-align :middle;"+
				"text-align:justify;"+
				"font-weight:bold;"+
				"color:"+textCol+";"+
				"}"+

				".PageBackground"+
				"{"+
				"background-color:Silver;"+
				"}";

    
    ss1.setAttribute("type", "text/css");
    ss1.styleSheet.cssText = def;
    var hh1 = document.getElementsByTagName('head')[0];
    hh1.appendChild(ss1);
    
  
    }



  
	
		    if(getQueryVariable("preview")==null)
			{
			lnknew.setAttribute('href',hdnPath+'bizmain.css');
			lnknew.setAttribute('type','text/css');
            lnknew.setAttribute('rel','stylesheet');
			}
			else
			{
			
			}
   
    
    document.getElementById('DivLoaded').style.display='block';
    document.getElementById('loadtext').style.display='none';


    }

*/
/*
 function AddCss()
    {
    

    if (document.images) 
				document.ProgBar.src='Images/Spacer.gif';			
	document.getElementById('loadtext').style.display='none';
	
    var hdnPath=document.getElementById('hdnpath').value;

    var lnknew=document.createElement('LINK');



    document.getElementById('myhead').insertBefore(lnknew,document.getElementById('Parentlnk'));
		   
		    if(getQueryVariable("preview")==null)
			{
			lnknew.setAttribute('href',hdnPath+'bizmain.css');
			}
			else
			{
			lnknew.setAttribute('href',hdnPath+'preview.css');
			}
    
    lnknew.setAttribute('type','text/css');
    lnknew.setAttribute('rel','stylesheet');
    
    document.getElementById('DivLoaded').style.display='block';
    document.getElementById('loadtext').style.display='none';


    }
    
*/
function getQueryVariable(variable) {
  var query = window.location.search.substring(1);
  var vars = query.split("&");
  for (var i=0;i<vars.length;i++) {
    var pair = vars[i].split("=");
    if (pair[0] == variable) {
      return pair[1];
    }
  } 
}
function ViewCoupons(e,RestaurantInfoID)
{
//alert(getQueryVariable("preview"));
if(getQueryVariable("preview")==null)
{
//window.open("../../dev/couponDetails.aspx","_self");
window.open("http://"+document.domain+"/BusinessDetails/couponDetails.aspx?RestaurantInfoID="+RestaurantInfoID,"_self");
}
else
{
window.open("http://"+document.domain+"/BusinessDetails/couponDetails.aspx?RestaurantInfoID="+RestaurantInfoID+"&preview=piyushnema","_self");
}
if(document.all)
  {
  event.returnValue=false;
  }
else
  {
 
  e.preventDefault();
  event.returnValue=false;  
  }


}
function ViewSpecials()
{
window.open("../../dev/GetSpecials.aspx","_self");
event.returnValue=false;
}

function ViewLargeImage(strImageUrlFile,UniqueName)
{
/*
alert(1);
var FileName=document.getElementById('image1').src;
alert("2"+FileName);
var strFileName=FileName.substring(FileName.lastIndexOf('/')+1 ,FileName.length);
alert("3"+strFileName);
window.open("http://"+document.domain+"/BusinessDetails/LargeView.aspx?strUniqueName="+UniqueName+"&strImageUrlFile="+strFileName);
*/


var FileName=document.getElementById('Image1').src;

FileName=FileName.replace("%5C",'/');

var strFileName=FileName.substring(FileName.lastIndexOf('/')+1 ,FileName.length);

window.open("http://"+document.domain+"/BusinessDetails/LargeView.aspx?strUniqueName="+UniqueName+"&strImageUrlFile="+strFileName);

}

var flag=0;

function TestFuction(ResturentInfoID,e)
{

if(flag==0)
{

document.getElementById('trvideo').style.display="";

if(document.getElementById('trPhoto')!=null)
{
document.getElementById('trPhoto').style.display="none";
}
document.getElementById('iframeVideo').style.display="";
//document.getElementById('iframeVideo').src="../../owners/DefaultVideoNew.aspx?RestaurantInfoID="+ResturentInfoID;
document.getElementById('iframeVideo').src="http://"+document.domain+"/BusinessDetails/DefaultVideoNew.aspx?RestaurantInfoID="+ResturentInfoID;
//alert(document.getElementById('iframeVideo').src);
//document.getElementById('iframeVideo').src="http://tablenow.pbhllc.com/owners/DefaultVideo.aspx?RestaurantInfoID="+ResturentInfoID;
document.getElementById('linkVideoGallery').innerHTML="View Photo";
flag=1;

}
else
{

document.getElementById('trvideo').style.height="0px";
document.getElementById('trvideo').style.display="none";
if(document.getElementById('trPhoto')!=null)
{
document.getElementById('trPhoto').style.display="";
}
document.getElementById('iframeVideo').style.display="none";
document.getElementById('iframeVideo').src="";

document.getElementById('linkVideoGallery').innerHTML="View Video";
flag=0;

}


if(document.all)
  {
  event.returnValue=false;
  }
else
  {

  e.preventDefault();
  event.returnValue=false;  
  }

}

/*
function TestFuction(ResturentInfoID)
{

if(flag==0)
{

document.getElementById('trvideo').style.display="block";
document.getElementById('trPhoto').style.display="none";
document.getElementById('iframeVideo').style.display="block";
document.getElementById('iframeVideo').src="../../owners/DefaultVideo.aspx?RestaurantInfoID="+ResturentInfoID;
//document.getElementById('iframeVideo').src="http://tablenow.pbhllc.com/owners/DefaultVideo.aspx?RestaurantInfoID="+ResturentInfoID;
document.getElementById('linkVideoGallery').innerText="View Photo";
flag=1;
}
else
{
document.getElementById('trvideo').style.height="0px";
document.getElementById('trvideo').style.display="none";
document.getElementById('trPhoto').style.display="block";

document.getElementById('iframeVideo').style.display="none";
document.getElementById('iframeVideo').src="";

document.getElementById('linkVideoGallery').innerText="View Video";
flag=0;
}

event.returnValue=false;

}
*/

function PrintPage()
{ 
  //if(confirm('To print this page, click OK'))
    //  {
    //getElementById("imgNorth")
//alert(document.all.mapRestaurant.src);
    window.print();

 //   }

event.returnValue=false;    
}

var flg=0;
function GetPhotoGallery(DetailFrame,e)
{
var FrameName=document.getElementById(DetailFrame);
if(flg==0)
{
		
		FrameName.src="RestaurantImagesBlist.aspx";
		FrameName.style.height="80px";
		if(document.all)
				{
				document.getElementById('tdPhoto').style.display="block";
				FrameName.style.display="block";
				}
				else
				{
				document.getElementById('tdPhoto').style.display="";
				FrameName.style.display="";
				e.preventDefault(); 

				
				}
		
		event.returnValue=false;
		document.getElementById('lnkPhotoGallery').innerText="Hide Photo Gallery";
		flg=1;
}
else
{
flg=0;

		FrameName.src="";


document.getElementById('lnkPhotoGallery').innerText="Photo Gallery";
document.getElementById('tdPhoto').style.display="none";

		event.returnValue=false;


}
		
}

function ShowLargerMap(strAddress,strCityState)
	{
		//var uri = "";
		//var mapAddress=document.getElementById("hdn1").value;
		
		// Source = 1: To directions
		//uri = "http://maps.google.com/maps?longitude=" + longitude + "&latitude=" + latitude;
		uri = "http://maps.google.com/maps?saddr=" + strAddress + "%2c+" + strCityState;
		
		//uri = "http://www.ll247.com/go.aspx?site=437&ver=1.0&act=getmapdirections&cat=profile&cs=2&cid=4357ec03-ae8b-4c09-be7d-e1e9bc2ea8f8&sid=007c5226-64fd-4899-b900-f6da12d881a3&step=1&to=" + escape(uri);
		window.open(uri, "googlemap");
		event.returnValue=false;

	}

function Send2Friend(DetailFrame,RestaurantInfoID,e)
{
		
		document.getElementById('tdframe').style.display="block";
		var FrameName=document.getElementById(DetailFrame);
		FrameName.style.display="block";
		FrameName.style.height="300px"
		FrameName.src="SendtoFriend.aspx";
		event.returnValue=false;
		
}


function GetSend2Cell(DetailFrame,RestaurantInfoID,CSSPath,e)
{
//alert(CSSPath);
	var FrameName=document.getElementById(DetailFrame);
	FrameName.style.height="100px";
	//alert(document.domain);

	FrameName.src="http://"+document.domain+"/BusinessDetails/send.aspx?RestaurantInfoID="+RestaurantInfoID+"&CSSPath="+CSSPath;
	//alert(FrameName.src);
		if(document.all)
				{	
		
		document.getElementById('tdframe').style.display="block";
		
		FrameName.style.display="block";
		}
		else
		{
		document.getElementById('tdframe').style.display="";
		
		FrameName.style.display="";
		e.preventDefault(); 
		}
		
		event.returnValue=false;
		
		
}

function SendEmail(DetailFrame,RestaurantInfoID,CSSPath,e)
{
		var FrameName=document.getElementById(DetailFrame);
		FrameName.style.height="190px"
		FrameName.src="http://"+document.domain+"/BusinessDetails/EmailUs.aspx?CSSPath="+CSSPath;
		
		if(document.all)
				{	

		document.getElementById('tdframe').style.display="block";
		
		FrameName.style.display="block";
		}
		else
		{
		document.getElementById('tdframe').style.display="";
		
		FrameName.style.display="";
		e.preventDefault(); 


		}
		
		event.returnValue=false;
		
}


function GetMap(ResturentInfoID,longitude,latitude)
{
		
		//document.getElementById('tdframe').style.display="block";
		//var FrameName=document.getElementById(DetailFrame);
		//FrameName.src="http://tablenow.pbhllc.com/tablenowinfo-map-iframe.aspx?&amp;longitude="+longitude+"&amp;latitude="+latitude+"&amp;radius=2&amp;RestaurantInfoID="+ResturentInfoID;
		window.open("http://tablenow.pbhllc.com/tablenowinfo-map-iframe.aspx?&amp;longitude="+longitude+"&amp;latitude="+latitude+"&amp;radius=2&amp;RestaurantInfoID="+ResturentInfoID);
		//FrameName.src="http://tablenow.pbhllc.com/tablenowinfo-map-iframe.aspx?&amp;longitude="+longitude+"&amp;latitude="+latitude+"&amp;radius=2&amp;RestaurantInfoID="+ResturentInfoID;
		event.returnValue=false;
		//event.returnValue=false;
	
}

function GetDirection(DetailFrame,RestaurantInfoID,e,color)
{
		if(color==null)
		{
		color="ffffff";
		}
		//document.getElementById('tdframe').style.display="block";
		var FrameName=document.getElementById(DetailFrame);
		
		FrameName.style.height="100px"
		FrameName.src="http://"+document.domain+"/BusinessDetails/DrivingDirection.aspx?RestaurantInfoID="+RestaurantInfoID+"&color="+color;
		if(document.all)
				{	

				FrameName.style.display="block";
				}
				else
				{
				FrameName.style.display="";
				e.preventDefault(); 



				}
		event.returnValue=false;
	
}



function get()
{
	var FrameName=document.getElementById('map');
	//alert(FrameName);	
	document.getElementById('map').style.display="block";
	document.getElementById('map').style.height="120px"
//		window.open("DrivingDirection.aspx?RestaurantInfoID="+123); 
	document.getElementById('map').src="DrivingDirection.aspx?RestaurantInfoID="+123;
		//alert(FrameName.src);
		event.returnValue=false;
}
function openurl(url)
{
	//var website="http:\\"+url;
	window.open('http://'+url);
	event.returnValue=false;
}


