// <SCRIPT LANGUAGE="JavaScript" SRC="scripts/functions.js"></SCRIPT>


function MM_openBrWindow(theURL,winName,features) { //v2.0
  window.open(theURL,winName,features);
}

var newwindow;
function popit(url)
{
	newwindow=window.open(url,'name','height=625,width=525');
	if (window.focus) {newwindow.focus()}
}

function openNewWindow(URLtoOpen, windowName, windowFeatures) { 
  newWindow=window.open(URLtoOpen, windowName, windowFeatures);
}


// button rollover

function MM_swapImgRestore() { //v3.0
  var i,x,a=document.MM_sr; for(i=0;a&&i<a.length&&(x=a[i])&&x.oSrc;i++) x.src=x.oSrc;
}

function MM_preloadImages() { //v3.0
  var d=document; if(d.images){ if(!d.MM_p) d.MM_p=new Array();
    var i,j=d.MM_p.length,a=MM_preloadImages.arguments; for(i=0; i<a.length; i++)
    if (a[i].indexOf("#")!=0){ d.MM_p[j]=new Image; d.MM_p[j++].src=a[i];}}
}

function MM_findObj(n, d) { //v4.01
  var p,i,x;  if(!d) d=document; if((p=n.indexOf("?"))>0&&parent.frames.length) {
    d=parent.frames[n.substring(p+1)].document; n=n.substring(0,p);}
  if(!(x=d[n])&&d.all) x=d.all[n]; for (i=0;!x&&i<d.forms.length;i++) x=d.forms[i][n];
  for(i=0;!x&&d.layers&&i<d.layers.length;i++) x=MM_findObj(n,d.layers[i].document);
  if(!x && d.getElementById) x=d.getElementById(n); return x;
}

function MM_swapImage() { //v3.0
  var i,j=0,x,a=MM_swapImage.arguments; document.MM_sr=new Array; for(i=0;i<(a.length-2);i+=3)
   if ((x=MM_findObj(a[i]))!=null){document.MM_sr[j++]=x; if(!x.oSrc) x.oSrc=x.src; x.src=a[i+2];}
}

//end

// ILT PopUp - all browsers

function expandingILTpopup(website) {
var windowprops='width=5,height=5,scrollbars=no,status=no,resizable=no'
var heightspeed = 2; // vertical scrolling speed (higher = slower)
var widthspeed = 5;  // horizontal scrolling speed (higher = slower)
var leftdist = 50;    // distance to left edge of window
var topdist = 50;     // distance to top edge of window

if (window.resizeTo&&navigator.userAgent.indexOf("Opera")==-1) {
var winwidth = 263;
var winheight = 375;
var sizer = window.open("","","left=" + leftdist + ",top=" + topdist +","+ windowprops);
for (sizeheight = 1; sizeheight < winheight; sizeheight += heightspeed)
sizer.resizeTo("1", sizeheight);
for (sizewidth = 1; sizewidth < winwidth; sizewidth += widthspeed)
sizer.resizeTo(sizewidth, sizeheight);
sizer.location = website;
}
else
window.open(website,'mywindow');
}

// Misc Popup - all browsers

function expandingChefspick(website) {
var windowprops='width=5,height=5,scrollbars=no,status=no,resizable=no'
var heightspeed = 2; // vertical scrolling speed (higher = slower)
var widthspeed = 5;  // horizontal scrolling speed (higher = slower)
var leftdist = 50;    // distance to left edge of window
var topdist = 50;     // distance to top edge of window

if (window.resizeTo&&navigator.userAgent.indexOf("Opera")==-1) {
var winwidth = 370;
var winheight = 490;
var sizer = window.open("","","left=" + leftdist + ",top=" + topdist +","+ windowprops);
for (sizeheight = 1; sizeheight < winheight; sizeheight += heightspeed)
sizer.resizeTo("1", sizeheight);
for (sizewidth = 1; sizewidth < winwidth; sizewidth += widthspeed)
sizer.resizeTo(sizewidth, sizeheight);
sizer.location = website;
}
else
window.open(website,'mywindow');
}

function expandingNews(website) {
var windowprops='width=5,height=5,scrollbars=yes,status=no,resizable=no'
var heightspeed = 2; // vertical scrolling speed (higher = slower)
var widthspeed = 5;  // horizontal scrolling speed (higher = slower)
var leftdist = 50;    // distance to left edge of window
var topdist = 50;     // distance to top edge of window

if (window.resizeTo&&navigator.userAgent.indexOf("Opera")==-1) {
var winwidth = 370;
var winheight = 490;
var sizer = window.open("","","left=" + leftdist + ",top=" + topdist +","+ windowprops);
for (sizeheight = 1; sizeheight < winheight; sizeheight += heightspeed)
sizer.resizeTo("1", sizeheight);
for (sizewidth = 1; sizewidth < winwidth; sizewidth += widthspeed)
sizer.resizeTo(sizewidth, sizeheight);
sizer.location = website;
}
else
window.open(website,'mywindow');
}

function expandingVidpop(website) {
var windowprops='width=5,height=5,scrollbars=yes,status=no,resizable=no'
var heightspeed = 2; // vertical scrolling speed (higher = slower)
var widthspeed = 5;  // horizontal scrolling speed (higher = slower)
var leftdist = 50;    // distance to left edge of window
var topdist = 50;     // distance to top edge of window

if (window.resizeTo&&navigator.userAgent.indexOf("Opera")==-1) {
var winwidth = 450;
var winheight = 660;
var sizer = window.open("","","left=" + leftdist + ",top=" + topdist +","+ windowprops);
for (sizeheight = 1; sizeheight < winheight; sizeheight += heightspeed)
sizer.resizeTo("1", sizeheight);
for (sizewidth = 1; sizewidth < winwidth; sizewidth += widthspeed)
sizer.resizeTo(sizewidth, sizeheight);
sizer.location = website;
}
else
window.open(website,'mywindow');
}


//////begin

function MakeBottomWindow() {
// Change URL for the new, bottom window.
var url = 'tryagain.HTM';
// Width and height of new window (specified in pixels).
//var width = '800';
//var height = '600';
// Nothing else needs changing.
//var p = 'scrollbars=yes,resizable=yes,toolbar=yes,' +
//'menubar=yes,status=yes,location=yes,height=' +
//height + ',width=' + width;
//var botwin = window.open(url,'',p);
var botwin = window.open(url).blur;
self.focus();
}
//////end


//Pop-under window- By JavaScript Kit
//Credit notice must stay intact for use
//Visit http://javascriptkit.com for this script

//specify page to pop-under
var popunder="tryagain.HTM"

//specify popunder window features
//set 1 to enable a particular feature, 0 to disable
//var winfeatures="width=800,height=510,scrollbars=1,resizable=1,toolbar=1,location=1,menubar=1,status=1,directories=0"

//Pop-under only once per browser session? (0=no, 1=yes)
//Specifying 0 will cause popunder to load every time page is loaded
var once_per_session=0

///No editing beyond here required/////

function get_cookie(Name) {
  var search = Name + "="
  var returnvalue = "";
  if (document.cookie.length > 0) {
    offset = document.cookie.indexOf(search)
    if (offset != -1) { // if cookie exists
      offset += search.length
      // set index of beginning of value
      end = document.cookie.indexOf(";", offset);
      // set index of end of cookie value
      if (end == -1)
         end = document.cookie.length;
      returnvalue=unescape(document.cookie.substring(offset, end))
      }
   }
  return returnvalue;
}

function loadornot(){
if (get_cookie('popunder')==''){
loadpopunder()
document.cookie="popunder=yes"
}
}

function loadpopunder(){
win2=window.open(popunder,"","fullscreen,scrollbars")
win2.blur()
window.focus()
}

function loadit(){
if (once_per_session==0)
loadpopunder()
else
loadornot()
}




