//alert(widthsize);
//alert(alignment);
// Links
var LINKcontact ='<a href="http://www.gm.tv/index.cfm?articleid=678" alt="Link to Contact Us" title="Link to Contact Us" target="_top" class="aheaderwhitelink">'
var LINKcht = '<a href="http://chatroom.gm.tv/" alt="Link to Message Boards" title="Link to Message Boards" target="_top" class="aheaderwhitelink">'
var LINK1 = '<a href="http://www.gm.tv/index.cfm?articleid=1" title="GMTV Logo: Link to Home"  alt="GMTV Logo: Link to Home">'
var LINK2 = '<a href="http://www.gm.tv/index.cfm?articleid=2932" alt="Link to GMTV Weather" title="Link to GMTV Weather" target="_top" class="aheaderwhitelink">'
var LINK3 = '&nbsp;<a href="http://www.gm.tv/index.cfm?articleid=2932" class="weatherWhite" title="Link to &#39;Today&#39;s Weather&#39;">Today&#39;s Weather</a>'
var LINKe = '</a>'
var LINK4 = '<a class="aheaderwhitelink" alt="Link to &##39;Today&##39;s forecast&##39;" title="Link to &##39;Today&##39;s forecast&##39;" target="_top" href="http://www.gm.tv/index.cfm?articleID=2932&showWorldRegion=3&showCities=YES">'

//divs
var DIV1 = '</div><div id="weather_rotator" style="width:94px; float:left; padding-top:3px; padding-left:2px; align:right;">'

// Images
var IMGhdr = '<img src="http://www.gm.tv/images/home/header_logo.gif" alt="GMTV Logo: Link to Home" width="149" height="100" hspace="20" border="0"/>'

var IMG4 = '<img src="http://www.gm.tv/misc/affiliates/navigation/images/fillet.gif" width="15" height="34" alt="" border="0">'
var IMG5 = LINK2+'<img border="0" src="http://www.gm.tv/misc/affiliates/navigation/images/weathericon.gif" width="33" height="34" alt="image depicting a weather cloud" title="Check the weather...">'+LINKe
var IMGshp = '<img src="http://www.gm.tv/images/shopcart.gif" width="15" height="15" alt="GMTV Shopping Cart">'
// Form Tags
var url1 = 'url(http://www.gm.tv/images/banner/blank.gif)';
var input1 = '<input type="text" name="keyword" id="keywords" value="" size="60" maxlength="45" style="vertical-align:middle;background-image:url(http://www.gm.tv/images/banner/blank.gif); background-repeat:no-repeat; background-position:center;width:190px;height:21px;"><input type="hidden" name="articleid" value="1">'

var sForm = '<form action="http://www.gm.tv/utilities/action/act_externalsearch.cfm" target="_blank" method="get" name="sitesearchboxform" id="sitesearchboxform"  style="margin : 0; border : 0;" >'
var Radio = '<input type="radio" name="articleaction" style="vertical-align : middle; border: none;" value="'
var input2 = '<input type="image" src="http://www.gm.tv/images/search_button.gif" style="vertical-align:middle;" width="59" height="19" alt="image depicting a search button" title="Search Now" style="border : none;" /><input type="radio" name="articleaction" style="border: none; vertical-align:middle;" value="2" checked>'
var sButt = '<input type="image" src="http://www.gm.tv/misc/affiliates/navigation/images/searchbut.gif" width="24" height="34" alt="image depicting a search button" title="Search Now" style="border : none;">'
var label = '<label style="color : #' + GMTVTxtColor + '; padding : 0px 0px 0 0px; vertical-align : -10%; border: none;" for="searchtype">'
var label1 = '<label style="color : rgb(0, 0, 204); padding : 0px 0px 0 0px; vertical-align : -10%; border: none;" for="searchtype">'
var eForm = '</form>'
var input3 = '<input type="radio" name="articleaction" style="border: none; vertical-align:middle;" value="3" >'

//document.write(sForm)
//document.write(Input)
//document.write(eForm)

//  DIV Tag 
document.write('<div style="width : 760px; padding-bottom : 5px;')
if (GMTVBanner != 1){
	document.write('padding-top : 5px;')
}
document.write('">')

document.write(sForm)
document.write('</td></tr><td width="'+widthsize+'"align="'+alignment+'"><table width="'+widthsize+'" height="100" border="0" cellpadding="0" cellspacing="0" background="http://www.gm.tv/images/home/header_tile.gif">')
document.write('<tr>')
document.write('<td width="169" rowspan="2">'+LINK1+IMGhdr+LINKe+'</td>')
document.write('<td width="100%" height="30" valign="bottom" style="padding-right:10px;text-decoration : none;font-weight : normal;color:##FFFFFF;">')
document.write('<div style="float:right;')
document.write('">')
document.write('<div style="width:263px; float:left;')
document.write('">'+LINKcontact+'Contact&nbsp;Us&nbsp;|'+LINKe+'&nbsp;'+LINKcht+'Message&nbsp;Boards&nbsp;|'+LINKe+'&nbsp;'+LINK2+'GMTV&nbsp;Weather&nbsp;|'+LINKe+'&nbsp;'+DIV1+LINK4+'Todays&nbsp;Forecast'+LINKe+'</div></div>')
document.write('</td></tr><tr><td height="70" valign="middle" align="right" style="padding-right:10px;">')
document.write(input1)
document.write('&nbsp;'+input2+label1+'GM.TV</label>')
document.write(input3+label1+IMGshp+'Shopping</label>')
document.write('</td>')
document.write('</tr>')
document.write('</table>')
document.write('</form>')

// Menu
document.write('<div style="width : "'+widthsize+'" padding-bottom : 5px; padding-top : 5px;')
document.write('">')
if (GMTVMenu != 1){
document.write('<table width="'+widthsize+'" cellpadding="0" cellspacing="0" border="0" summary="display of toplevelnav"><tr>')
document.write('<td class="bgcolor" width="'+widthsize+'" align="center">')
var i = 1; 
while ( i <= menulength ) { //+'&affid='+GMTVaffilatesID
	var num = i;
	document.write('<a href="'+gmtvlinkaddress+eval("menu"+num+"ID")+'" style="color:#ffffff;background-color : #0033CC;font-family : Arial, Verdana, Helvetica, Geneva, sans-serif; font-size : 75%;font-weight : bold;text-decoration : none;" title="Link to &#39;'+eval("menu"+num+"name")+'&#39;">&nbsp;'+eval("menu"+num+"name")+'&nbsp;</a>')
	if (i != menulength) { document.write(linkspan) }
	i++; 
} 
document.write('</td>')
document.write('</tr>')
document.write('</table>')
document.write('</div>')
}
document.write('</td></tr></table>')
document.write('</div>')
document.write('</td></tr></table>')

//div rotator
			  
var item=new Array()
item[0]="<a class='aheaderwhitelink' alt='Link to &##39;Today&##39;s forecast&##39;' title='Link to &##39;Today&##39;s forecast&##39;' target='_top' href='http://www.gm.tv/index.cfm?articleID=2932&showWorldRegion=3&showCities=YES'>Today's forecast</a>"
item[1]="<a class='aheaderwhitelink' alt='Link to &##39;5-day outlook&##39;' title='Link to &##39;5-day outlook&##39;' target='_top' href='http://www.gm.tv/index.cfm?articleID=2932&showCitySearch=1&showCities=YES'>5-day outlook</a>"
item[2]="<a class='aheaderwhitelink' alt='Link to &##39;Holiday hotspots&##39;' title='Link to &##39;Holiday hotspots&##39;' target='_top' href='http://www.gm.tv/index.cfm?articleID=2932&showWorldRegion=1&showCities=YES'>Holiday hotspots</a>"
item[3]="<a class='aheaderwhitelink' alt='Link to &##39;UV factor&##39;' title='Link to &##39;UV factor&##39;' target='_top' href='http://www.gm.tv/index.cfm?showRegionID=16&showCities=YES&symbolPrefix=u&articleID=2932&showWorldRegion=3&showTab=1'>UV factor</a>"

var current=0

var ns6=document.getElementById&&!document.all
function changeItem(){
if(document.layers){
document.layer1.document.write(item[current])
document.layer1.document.close()
}
if(ns6)document.getElementById("weather_rotator").innerHTML=item[current]
{
if(document.all){
weather_rotator.innerHTML=item[current]
}
}
if (current==3) current=0
else current++
setTimeout("changeItem()",4000)
}
      var oldonload = window.onload;

      if(typeof window.onload != 'function'){

            window.onload = changeItem;

      }else{

            window.onload = function(){

                  oldonload();

                  changeItem();

            }

      }

