/***********************************************
* Scrollable content Script- © Dynamic Drive (www.dynamicdrive.com)
* This notice must stay intact for use
* Visit http://www.dynamicdrive.com/ for full source code
***********************************************/

function writeContent() {
    document.getElementById("myHole").innerHTML =
         '<table border="0" cellpadding="0" cellspacing="0" width="950"><tr><td background="http://216.128.12.36/sites/toyota/assets/bar.jpg" align="right">' +
        '<a href="javascript:clearContent();"><img src="http://216.128.12.36/sites/goerie/assets/close.jpg" border="0"></td></tr><tr><td>' +
	'<iframe src="http://216.128.12.36/sites/toyota/toyota_expand.html" width="950" height="300" scrolling="no" frameborder="0"></iframe>' +
        '</td></tr></table>';
}
function clearContent() {
   document.getElementById("myHole").innerHTML = "";
}
 function removeHandler(obj) {
     object.onclick = null;
 }

var nsstyle='display:""'
if (document.layers)
var scrolldoc=document.scroll1.document.scroll2
function up(){
if (!document.layers) return
if (scrolldoc.top<0)
scrolldoc.top+=10
temp2=setTimeout("up()",50)
}
function down(){
if (!document.layers) return
if (scrolldoc.top-150>=scrolldoc.document.height*-1)
scrolldoc.top-=10
temp=setTimeout("down()",50)
}

function clearup(){
if (window.temp2)
clearInterval(temp2)
}

function cleardown(){
if (window.temp)
clearInterval(temp)
}

function MM_showHideLayers(x,y) {
	var aLayer = document.getElementById(x).style;
    aLayer.display="none";
	var bLayer = document.getElementById(y).style;
	bLayer.display="block";
}
function readCookie(name)
{
  var nameEQ = name + "=";
  var ca = document.cookie.split(';');
  for(var i=0;i < ca.length;i++)
  {
    var c = ca[i];
    while (c.charAt(0)==' ')
      c = c.substring(1,c.length);
    if (c.indexOf(nameEQ) == 0)
      return c.substring(nameEQ.length,c.length);
  }
}
mycookieval = readCookie('CSDemos');
myfirst = readCookie('CSDemos') + '|end';
myfirst = myfirst.substring((myfirst.indexOf('nameFirst:')) + 10, (myfirst.indexOf('|')) );
function newCookie (name, value, expires)
{
  if (!expires) expires = new Date();
  document.cookie = name + "=" + escape (value) +
    "; expires=" + expires.toGMTString() +  "; path=/; domain=.goerie.com";
}
function killCookie ()
{
  var expdate = new Date ();
  expdate.setTime (expdate.getTime() + (1000*60*01*01*01));
  newCookie ("CSDemos", "", expdate);
  winlocation="https://home.goerie.com/clickshare/logout.do?CSTargetURL=" + window.location.href;
  window.location.href=winlocation;
}

function loadVideo(divID, videoFile) {
  document.getElementById(divID).innerHTML =
      '<object id="VIDEO" name="VIDEO" type="video/x-ms-wmv"' +
      ' data="' + videoFile + '"' +
      ' width="240" height="180">' +
      '<param name="src" value="' + videoFile + '" />' +
      '<param name="autostart" value="true" />' +
      '<param name="controller" value="true" />' +
      '</object>';
}
		var agt=navigator.userAgent.toLowerCase();

		var is_major = parseInt(navigator.appVersion);
		var is_minor = parseFloat(navigator.appVersion);

		var is_nav  = ((agt.indexOf('mozilla')!=-1) && (agt.indexOf('spoofer')==-1)
		            && (agt.indexOf('compatible') == -1) && (agt.indexOf('opera')==-1)
		            && (agt.indexOf('webtv')==-1));
		var NS4 = (is_nav && (is_major >= 4));
		var is_ie   = (agt.indexOf("msie") != -1);
		var is_ie3  = (is_ie && (is_major < 4));
		var is_ie4  = (is_ie && (is_major == 4) && (agt.indexOf("msie 5.0")==-1) );
		var IE4  = (is_ie  && (is_major >= 4));
		var IE5  = (is_ie  && !is_ie3 && !is_ie4);
		var ver4 = (NS4 || IE4) ? true : false;

		function NewWindowWMenu(bredde,hoyde,url) {
			window.open(url,"ShowProdWindowM","menubars=0,menu=1,scrollbars=1,resizable=1,height="+hoyde+",width="+bredde);
		}

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_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_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];}
}

function new_window(url) {
link = window.open(url,"Link","toolbar=0,location=0,directories=0,status=0,menubar=0,scrollbars=0,resizable=0,width=600,height=500,left=200,top=200");
}

function new_window2(url) {
link = window.open(url,"Link","toolbar=0,location=0,directories=0,status=0,menubar=0,scrollbars=0,resizable=0,width=500,height=500,left=200,top=200");
}

function Go(url) {
 newurl = url;
 q = window.location.search.substr(1).toLowerCase().split("&");
 for (i=0; i<q.length; i++) {
  if (q[i].substr(0,9) == "expnodes=") {
   newurl += "&"+q[i];
   break;
  }
 }
 window.location = newurl;
}

function tipVen(bredde,hoyde,url,thisScrollbars,thisResize) {
		window.open(url,"ShowProdWindow","menubars=0,scrollbars="+thisScrollbars+",resizable="+thisResize+",height="+hoyde+",width="+bredde);
}
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];
    }
  }
  return 999
}

function launchCenteredWin(url, name, width, height, otherfeatures)
{
  var str = "height=" + height + ",innerHeight=" + height;
  str += ",width=" + width + ",innerWidth=" + width;
  if (window.screen) {
    var ah = screen.availHeight - 30;
    var aw = screen.availWidth - 10;

    var xc = (aw - width) / 2;
    var yc = (ah - height) / 2;

    str += ",left=" + xc + ",screenX=" + xc;
    str += ",top=" + yc + ",screenY=" + yc;
  }
  newwin = window.open(url, name, str + ',' + otherfeatures);
  if(parseInt(navigator.appVersion) >= 4)
  {
	//delay a bit here because IE4 encounters errors
	//when trying to focus a recently opened window
 	setTimeout('newwin.focus();',250);
  }
}
function getManganFlashUrl()
{
	if (getQueryVariable("getmenu") == 999)
	{
		var flashUrl = "flash_content.html"
	}else
	{
		var flashUrl = "flash_content.html?getmenu=" + getQueryVariable("getmenu")
	}
}

function openLynxWindow(PageURL){
  WindowName="3f";
  settings="toolbar=no,location=no,directories=no,status=no,menubar=no,scrollbars=yes,resizable=yes,width=768,height=636";
  MyNewWindow=window.open(PageURL,WindowName,settings);
}

// JavaScript Document

/*
function MM_showHideLayers(x,y) {
	var aLayer = document.getElementById(x).style;
    aLayer.display="none";
	var bLayer = document.getElementById(y).style;
	bLayer.display="block";
}*/


function showHideTabXML(id,intlink,count,headlines,xmlFile,more) {

	var i = 1;

	while (i <= count) {

		if (id == i) {
			document.getElementById(intlink+i).style.backgroundImage="url(http://www.delawareonline.com/graphics/beta/sublinkover_bg.gif)";
			document.getElementById(intlink+i+"_d").style.display="block";
		}

		else {
			document.getElementById(intlink+i).style.backgroundImage="url(http://www.delawareonline.com/graphics/beta/sublink_bg.gif)";
			document.getElementById(intlink+i+"_d").style.display="none";
		}

		i++;

		}

			loadRSS(id,intlink,headlines,xmlFile,more);


}


function showHideTabSax(id,intlink,count) {
	var i = 1;

	while (i <= count) {

		if (id == i) {
			document.getElementById(intlink+i).style.backgroundImage="url(http://www.delawareonline.com/graphics/beta/sublinkover_bg.gif)";
			document.getElementById(intlink+i+"_d").style.display="block";
		}

		else {
			document.getElementById(intlink+i).style.backgroundImage="url(http://www.delawareonline.com/graphics/beta/sublink_bg.gif)";
			document.getElementById(intlink+i+"_d").style.display="none";
		}

		i++;

		}

}

function showHideIntLink(x,y) {
	var i = 1;

	while (i < 10) {

		if (x == i) {
			document.getElementById(y+i).style.backgroundImage="url(http://www.delawareonline.com/graphics/beta/sublinkover_bg.gif)";
			document.getElementById(y+i+"_d").style.display="block";
		}

		else {
			document.getElementById(y+i).style.backgroundImage="url(http://www.delawareonline.com/graphics/beta/sublink_bg.gif)";
			document.getElementById(y+i+"_d").style.display="none";
		}

		i++;

		}

}


function hideCommLink(count) {

			document.getElementById("communitiestab").style.backgroundImage="url(http://www.delawareonline.com/graphics/beta/sublinkover_bg.gif)";
			document.getElementById("communities").style.display="block";
			document.getElementById("yourcommunity").style.display="none";

			var i = 1;

			while (i <= count) {
			document.getElementById("yourcommunity"+i+"_d").style.display="none";
			i++;
			}



}

function showCommLink(id,community,intlink,headlines,xmlFile,more) {

			document.getElementById("communitiestab").style.backgroundImage="url(http://www.delawareonline.com/graphics/beta/sublink_bg.gif)";
			document.getElementById("yourcommunity"+id+"_d").style.display="block";
			document.getElementById("yourcommunity").style.display="block";
			document.getElementById("yourcommunity_name").innerHTML="<strong>" + community + "</strong>";
			document.getElementById("communities").style.display="none";

			loadRSS(id,intlink,headlines,xmlFile,more);
}



function overSubNav(x) {
	over.backgroundImage = "url(http://www.delawareonline.com/graphics/beta/nav_" + y + "_over.gif)";
}

function offSubNav(x) {
	image
}

function overImage(x,y) {
	var image = document.getElementById(y + x).style;
	image.backgroundImage = "url(http://www.delawareonline.com/graphics/beta/nav_" + y + "_over.gif)";
}

function offImage(x,y) {
	var image = document.getElementById(y + x).style;
	image.backgroundImage = "url(http://www.delawareonline.com/graphics/beta/nav_" + y + ".gif)";
}

function showLayer(x) {
	var layer = document.getElementById(x).style;
    layer.display="block";
}

function hideLayer(x) {
	var layer = document.getElementById(x).style;
    layer.display="none";
}

function showSummary(x) {

	var summary = document.getElementById("summary_" + x).style;
    summary.display="block";

	var collapse = document.getElementById("collapse_" + x).style;
	collapse.display="block";

	var expand = document.getElementById("expand_" + x).style;
	expand.display="none";

}


function hideSummary(x) {

	var summary = document.getElementById("summary_" + x).style;
    summary.display="none";

	var collapse = document.getElementById("collapse_" + x).style;
	collapse.display="none";

	var expand = document.getElementById("expand_" + x).style;
	expand.display="block";

}


function hideSubnav(x) {

	var subnav = document.getElementById("subnav" + x).style;
    subnav.display="none";

	var collapse = document.getElementById("collapse" + x).style;
	collapse.display="none";

	var expand = document.getElementById("expand" + x).style;
	expand.display="block";

}


function showSubnav(x) {

	var subnav = document.getElementById("subnav" + x).style;
    subnav.display="block";

	var nav = document.getElementById("nav" + x).style;
	nav.backgroundImage = "url(http://www.delawareonline.com/graphics/beta/navover_bg.gif)";
}

function showHideSubnav(x) {
	var i = 1;

	var expand = new Array();
	var collapse = new Array();
	var subnav = new Array();
	var nav = new Array();
	var navlink = new Array();

	while (i < 9) {

		if (i == x) {
			subnav[i] = this.document.getElementById("subnav" + x).style;
    		subnav[i].display="block";

			nav[i] = this.document.getElementById("nav" + x).style;
			nav[i].backgroundImage = "url(http://www.delawareonline.com/graphics/beta/navover_bg.gif)";

			navlink[i] = this.document.getElementById("nav" + x + "_link").style;
			navlink[i].backgroundImage = "url(http://www.delawareonline.com/graphics/beta/navover_bg.gif)";

			expand[i] = this.document.getElementById("expand" + x).style;
			expand[i].display="none";

			collapse[i] = this.document.getElementById("collapse" + x).style;
			collapse[i].display="block";
		}

		else {
			subnav[i] = this.document.getElementById("subnav" + i).style;
			subnav[i].display="none";

			nav[i] = this.document.getElementById("nav" + i).style;
			nav[i].backgroundImage = "url(http://www.delawareonline.com/graphics/beta/nav_bg.gif)";

			navlink[i] = this.document.getElementById("nav" + i + "_link").style;
			navlink[i].backgroundImage = "url(http://www.delawareonline.com/graphics/beta/nav_bg.gif)";

			expand[i] = this.document.getElementById("expand" + i).style;
			expand[i].display="block";

			collapse[i] = this.document.getElementById("collapse" + i).style;
			collapse[i].display="none";

		}

		i++;

	}
}