 var HeadTag=null;
 screenWidth = screen.width;
 //================***********************==============================
     var scrWidth = window.screen.width;
    var scrHeight = window.screen.height;
    var pageHeight=790;
    var pageWidth = 1024;
    
    if((window.navigator.platform.toLowerCase()=='macppc')&& (navigator.appName.toLowerCase() == 'netscape'))
    {   if(scrHeight<pageHeight)
         scrWidth = scrWidth - 19;
    }

    else
    {
    if(scrHeight<pageHeight) //if no vertical scroll
    {
        if(navigator.appName == 'Microsoft Internet Explorer')
        scrWidth = scrWidth - 21 ;
        else
        {
        scrWidth = scrWidth -  17;//(window.outerWidth - window.innerWidth)
        }
//mainDivWidth = scrWidth;
    }
    
    else
    {
    if(navigator.appName == 'Microsoft Internet Explorer')//IE alway leave the vertical scroll bar space, no matter whether it is there or not
    scrWidth = scrWidth - 21;
    }
    }

    
    var _bgLeft = "0px";
    var _bgWidth = "1024px";
    var mainDivWidth = "1024px";

    
    
    var setWidth= pageWidth;//1024;
    var pgWidth = pageWidth;//1024;

    if(scrWidth<pgWidth)
    {
    setWidth = scrWidth;
    var diffwidth =  pgWidth - scrWidth;
    var setLeft = 0;

    if(diffwidth>0)
    {
    setLeft=(diffwidth/2);
    _bgLeft= '-' + setLeft + 'px';
    }

_bgWidth=setWidth + setLeft + 'px';
mainDivWidth = setWidth + 'px';


}
else
{
_bgWidth = pgWidth + 'px';
_bgLeft =  '0px';
mainDivWidth = pgWidth + 'px';
}

//alert(_bgWidth + '  '+ _bgLeft + ' ' + mainDivWidth);
document.write("<style>#_bg{left:" + _bgLeft + ";width:" + _bgWidth + ";}#mainDiv{width:" + mainDivWidth +";}</style>");

//alert(_bgLeft + " " + _bgWidth +" "+   mainDivWidth);

//if(navigator.appName.toUpperCase() == "MICROSOFT INTERNET EXPLORER")
//    {
//    
//   If(navigator.appVersion.indexOf("MSIE 6.0")== '17' )
//    {
//    alert('1d'); 
//    document.getElementById('_bg').style.left = _bgLeft;
//    document.getElementById('_bg').style.width = _bgWidth;
//     document.getElementById('mainDiv').style.width = mainDivWidth;
//    }
//    }
//    

 //================************************=============================
    
     function reschange()
    {
        /*if(screenWidth != screen.width) 
        {
                window.location.reload(true);
               screenWidth = screen.width;
        }*/
        if(screenWidth != screen.width) {
           //window.location.href=window.location;
		   //window.event.keyCode = 116;
		   window.location.reload(true);
		   //document.location.reload();
               screenWidth = screen.width;
            }
          
    }
    
    function showpopup()
{
var popWidth=627;
document.getElementById('center_frame').src="/EmailToFriend.aspx";
document.getElementById('center_frame').style.display = 'block';  
document.getElementById('center_frame').style.height="450px";
document.getElementById('center_frame').style.width=popWidth +"px";
document.getElementById('center_frame').style.top= setFrameTop(450) + "px";//((window.screen.height-310)/2) +"px" ;//+ document.body.scrollTop; 
document.getElementById('center_frame').style.left=(window.screen.width-popWidth)/2 + "px";
document.getElementById('spread_frame').style.display='block';
document.getElementById('spread_frame').style.height=((document.body.scrollHeight)+50) + "px";
document.getElementById('spread_frame').style.width=document.body.scrollWidth;

}
	
	function showNewsandDeals()
{
var frameWidth= 627;

document.getElementById('center_frame').src="/NewsAndDeals.aspx";
document.getElementById('center_frame').style.display = 'block';  
document.getElementById('center_frame').style.width=frameWidth + 'px';
document.getElementById('center_frame').style.height='300px';


document.getElementById('center_frame').style.top= setFrameTop(310) + "px";//((window.screen.height-310)/2) +"px" ;//+ document.body.scrollTop; 
document.getElementById('center_frame').style.left=(window.screen.width-627)/2 + "px";
document.getElementById('spread_frame').style.display='block';

document.getElementById('spread_frame').style.height=((document.body.scrollHeight)+50) + "px";
document.getElementById('spread_frame').style.width=document.body.scrollWidth;

}
function musicdownload(filename)
{
window.location.href = "/downloadFile.aspx?Filename=" + filename;
}

function setFrameTop(frameHeight)
{
		var theight=document.documentElement.clientHeight;
		var diffHeight=theight-frameHeight;
		var flashTop=0;
		if(diffHeight>0)
		{frameTop=diffHeight/2};		
    //alert(frameTop);
    return frameTop;
}

function setheight(height)
{
document.getElementById('center_frame').style.height=height;
}
function CallSurvey()
{
var t=screen.availWidth/7;
var lt=screen.availHeight/3;
 window.open('https://www.surveymonkey.com/s.aspx?sm=kg3AeB6s4rNrv45t2avOBw%3d%3d', 'win', 'height=600,width=600,scrollbars=yes,resizable=yes,status=yes,left='+lt+',top='+t+'');
}
/*$(document).ready(function(){

$("body").append('<iframe id="spread_frame" src="/spreadpage.htm" class="spread"></iframe><iframe id="center_frame" frameborder="0" marginwidth="0" marginheight="0" height="320" width="500" src="/loading.htm" scrolling="no" class="modelPopup"></iframe>');

});*///moved to setwidth.js
