// piece of script added for search

var xmlHttp1;

function showsl(str)
{

var url="";
var num=0;

if(str == "WORLD")
{
url="/webx.html";
num=1;
}
else if(str == "iAfrica")
{
url="/allx.html";
num=1;
}
else if(str == "w")
{
document.main.search_for.selectedIndex = 0;
url="http://www.iafrica.com/scripts/webx.html";
}
else if(str == "a")
{
url="http://www.iafrica.com/allx.html";
}
else if(str == "1")
{
document.main1.search_for.selectedIndex = 0;
url="news.html";
}
else if(str == "2")
{
document.main1.search_for.selectedIndex = 0;
url="bus.html";
}
else if(str == "3")
{
document.main1.search_for.selectedIndex = 0;
url="sport.html";
}
else if(str == "4")
{
document.main1.search_for.selectedIndex = 0;
url="motor.html";
}
else if(str == "5")
{
document.main1.search_for.selectedIndex = 0;
url="ent.html";
}
else if(str == "6")
{
document.main1.search_for.selectedIndex = 0;
url="life.html";
}
else if(str == "7")
{
document.main1.search_for.selectedIndex = 0;
url="tech.html";
}
else if(str == "8")
{
document.main1.search_for.selectedIndex = 0;
url="travel.html";
}
else if(str == "9")
{
document.main1.search_for.selectedIndex = 0;
url="food.html";
}
else if(str == "10")
{
document.main1.search_for.selectedIndex = 0;
url="health.html";
}
else if(str == "11")
{
document.main1.search_for.selectedIndex = 0;
url="finance.html";
}
else if(str == "12")
{
document.main1.search_for.selectedIndex = 0;
url="property.html";
}
else
{

url="http://www.iafrica.com/scripts/allx.html";

}

xmlHttp1=GetXmlHttpObject();

if (xmlHttp1==null)
{
alert ("Browser does not support HTTP Request");
return;
}

if(num == 1)
{
xmlHttp1.onreadystatechange=stateChanged;
}
else
{
xmlHttp1.onreadystatechange=stateChangedo;
}




xmlHttp1.open("GET",url,true);
    xmlHttp1.send(null);

}


function stateChanged()
{

if (xmlHttp1.readyState==4 || xmlHttp1.readyState=="complete")
{

var script = document.createElement( 'script' );
script.type = 'text/javascript';
script.src = 'http://www.iafrica.com/search/wm.js';

document.getElementById("tsearch").innerHTML=xmlHttp1.responseText;
document.getElementById("tsearch").appendChild(script);

}

}

function stateChangedo()
{

if (xmlHttp1.readyState==4 || xmlHttp1.readyState=="complete")
{

var script = document.createElement( 'script' );
script.type = 'text/javascript';
script.src = 'http://www.google.com/coop/cse/brand?form=cse-search-box&lang=en';

document.getElementById("tsearch").innerHTML=xmlHttp1.responseText;
document.getElementById("tsearch").appendChild(script);

}

}

function GetXmlHttpObject()

{

var xmlHttp1=null;


try
{
// Firefox, Opera 8.0+, Safari
 xmlHttp1=new XMLHttpRequest();
 }
 catch (e)
 {
// // Internet Explorer
 try
 {
 xmlHttp1=new ActiveXObject("Msxml2.XMLHTTP");
 }
 catch (e)
 {
 xmlHttp1=new ActiveXObject("Microsoft.XMLHTTP");
 }

 }

 return xmlHttp1;

 }


// of piece of script added for search 






// set some defaults
 iedom=document.all||document.getElementById;
 
 myLifeStyle1 = null;

function goSponsor  (theURL){
mysponsor =  window.open(theURL,"thesponsor");
mysponsor.focus();
}

// <tab boxes rotation scripts>
	var v_newscript = 1;
	var v_arr = new Array(8);
	var vc_arr = new Array(8);
	var nxtblock = new Array(8);
	var vnext_arr = new Array(8);
	var vn_arr = new Array(8);
	var cur_tab = "c_userBlock_tag1";
	var tmout_tab = new Array(3);
	var vimg_arr = new Array(4);
	var v_timeout_tab = 13000;

	v_arr['mostRead'] = "MR";
	v_arr['mostCommented'] = "ME";
	v_arr['mostEmailed'] = "MC";
	v_arr['forum'] = "F";
	v_arr['blog'] = "B";
	v_arr['chat'] = "C";

	vnext_arr['MR'] = 1;
	vnext_arr['ME'] = 2;
	vnext_arr['MC'] = 3;
	vnext_arr['F'] = 4;
	vnext_arr['B'] = 5;
	vnext_arr['C'] = 6;
	
	vn_arr[0] = "mostCommented";
	vn_arr[1] = "mostEmailed";
	vn_arr[2] = "mostRead";
	vn_arr[3] = "blog";
	vn_arr[4] = "chat";
	vn_arr[5] = "forum";
	
	vc_arr[1] = "MR";
	vc_arr[2] = "ME";
	vc_arr[3] = "MC";
	vc_arr[4] = "F";
	vc_arr[5] = "B";
	vc_arr[6] = "C";	

	vimg_arr[1] = "url(/pics/pics_rev/tab_item_sel_bg_tile.gif) repeat-x";
	vimg_arr[2] = "url(/pics/pics_rev/tab_item_sel_bg_lft.gif) no-repeat";
	vimg_arr[3] = "url(/pics/pics_rev/tab_item_sel_bg_rht.gif) right no-repeat";
	
	nxtblock[1] = 1;
	nxtblock[2] = 4;	

	tmout_tab[1] = 0;
	tmout_tab[2] = 0;
	
function hide_content ( v_start, v_end ) {
	for ( i = v_start; i < v_end; i ++ ) {
		$("#c_userBlock_tag" + i).hide();
	}
}
function fade_next( blk ) {
	setuserBlock(vc_arr[nxtblock[blk]],'c_userBlock_tag' + nxtblock[blk], blk)
}

function setuserBlock (theTarget,theContent,theBlock){
	v_start = (theBlock-1) * 3 + 1;
	v_end = theBlock * 3 + 1;
	clearTimeout(tmout_tab[theBlock]);
	cur_tab = theContent;
	
	nxtblock[theBlock]++;
	if ( nxtblock[theBlock] >= v_end )
		nxtblock[theBlock] = v_start;

	for ( i = v_start; i < v_end; i ++ ) {
		for ( b = 1; b < 4; b ++ ) {
			v_str = "#" + vc_arr[i] + "_hd_" + b;
			$(v_str).css("background", "none").css("color", "#878787");
		}
	}

	for ( b = 1; b < 4; b ++ ) {
		v_str = "#" + theTarget + "_hd_" + b;
		$(v_str).css("background", vimg_arr[b]).css("color", "#00508e")
	}
	
	var item = $("#c_userBlock_display" + theBlock);
	var v_flt = item.css("filter");
	
	item.fadeOut("slow", function() {
		item.html($("#"+theContent).html());
		item.fadeIn("slow", function() {
			item.css("filter", v_flt);
			tmout_tab[theBlock] = setTimeout("fade_next(" + theBlock + ")", v_timeout_tab);
		});
	});
}
  
$(document).ready(function(){
	var adcode = '<!--JavaScript Tag // Tag for network 567: 365 Digital // Website: iafrica.com NEW // Page: ROS // Placement: ROS-Half Banner 1-298 x 60 (2030351) // created at: Nov 18, 2009 12:45:32 PM--> <script language="javascript"><!-- document.write(\'<scr\'+\'ipt language="javascript1.1" src="http://adserver.adtech.de/addyn|3.0|567|2030351|0|2371|ADTECH;loc=100;target=_blank;misc=\'+new Date().getTime()+\'"></scri\'+\'pt>\'); //--> </script><noscript><a href="http://adserver.adtech.de/adlink|3.0|567|2030351|0|2371|ADTECH;loc=300" target="_blank"><img src="http://adserver.adtech.de/adserv|3.0|567|2030351|0|2371|ADTECH;loc=300" border="0" width="298" height="60"></a></noscript> <!-- End of JavaScript Tag -->';
	var page_url = document.location.href;
	
	if ( page_url.substring(page_url.length-3) == "htm" )
	{
		/*$("#tabAdvertising").html('<div id=\"c_tab_advertising\"> <div id=\"ad_outsurance_tag\"> <iframe src=\"/php-bin/iac/outsurance.htm\" MARGINWIDTH=0 MARGINHEIGHT=0 HSPACE=0 VSPACE=0 FRAMEBORDER=0 SCROLLING=no BORDERCOLOR=#000000></iframe> </div> <div id=\"ad_outsurance\">  For <a href=\"http://www.outsurance.co.za/default.asp?ID=158\" target=\"_blank\">car insurance</a>, <a href=\"http://www.outsurance.co.za/default.asp?ID=364\" target=\"_blank\">home insurance</a> and <a href=\"http://www.outsurance.co.za/default.asp?ID=4\" target=\"_blank\">commercial insurance</a>. </div> </div>');
		//$("#tabAdvertising").html("<IFRAME SRC=\"http://ad.doubleclick.net/adi/N3643.iafr/B3590720.2;sz=298x120;ord=[timestamp]?\" WIDTH=298 HEIGHT=120 MARGINWIDTH=0 MARGINHEIGHT=0 HSPACE=0 VSPACE=0 FRAMEBORDER=0 SCROLLING=no BORDERCOLOR='#000000'> <SCRIPT language='JavaScript1.1' SRC=\"http://ad.doubleclick.net/adj/N3643.iafr/B3590720.2;abr=!ie;sz=298x120;ord=[timestamp]?\"> </SCRIPT> <NOSCRIPT> <A HREF=\"http://ad.doubleclick.net/jump/N3643.iafr/B3590720.2;abr=!ie4;abr=!ie5;sz=298x120;ord=[timestamp]?\"> <IMG SRC=\"http://ad.doubleclick.net/ad/N3643.iafr/B3590720.2;abr=!ie4;abr=!ie5;sz=298x120;ord=[timestamp]?\" BORDER=0 WIDTH=298 HEIGHT=120 ALT=\"Click here\"></A> </NOSCRIPT> </IFRAME>");*/		
		$("#tabAdvertising").html("<IFRAME WIDTH=\"298\" HEIGHT=\"120\" SCROLLING=\"No\" FRAMEBORDER=\"0\" MARGINHEIGHT=\"0\" MARGINWIDTH=\"0\" SRC=\"http://adserver.adtech.de/adiframe|3.0|567|2381494|0|3090|ADTECH;target=_blank;grp=[group]\"><script language=\"javascript\" src=\"http://adserver.adtech.de/addyn|3.0|567|2381494|0|3090|ADTECH;loc=700;target=_blank;grp=[group]\"></script><noscript><a href=\"http://adserver.adtech.de/adlink|3.0|567|2381494|0|3090|ADTECH;loc=300;grp=[group]\" target=\"_blank\"><img src=\"http://adserver.adtech.de/adserv|3.0|567|2381494|0|3090|ADTECH;loc=300;grp=[group]\" border=\"0\" width=\"298\" height=\"120\"></a></noscript></IFRAME>");
	}
	else
		//$("#tabAdvertising").html("<div id=\"c_tab_advertising\"> <div id=\"ad_outsurance_tag\"> <a href=\"http://ad.doubleclick.net/jump/N3643.iafr/B3590720;sz=298x80;ord=0123456789?\" target=\"_blank\"> <img src=\"http://ad.doubleclick.net/ad/N3643.iafr/B3590720;sz=298x80;ord=0123456789?\" width=\"298\" height=\"80\" border=\"0\" alt=\"Click here\" /></a> </div> <div id=\"ad_outsurance\">  For <a href=\"http://www.outsurance.co.za/default.asp?ID=158\" target=\"_blank\">car insurance</a>, <a href=\"http://www.outsurance.co.za/default.asp?ID=364\" target=\"_blank\">home insurance</a> and <a href=\"http://www.outsurance.co.za/default.asp?ID=4\" target=\"_blank\">commercial insurance</a>. </div> </div>");	
		$("#tabAdvertising").html("<div id=\"c_tab_advertising\"> <div id=\"ad_outsurance_tag\"> <iframe src=\"/php-bin/iac/outsurance.htm\" MARGINWIDTH=0 MARGINHEIGHT=0 HSPACE=0 VSPACE=0 FRAMEBORDER=0 SCROLLING=no BORDERCOLOR=#000000></iframe> </div> <div id=\"ad_outsurance\">  For <a href=\"http://www.outsurance.co.za/personal/car-insurance/?source=iafrica&cr=dl\" target=\"_blank\">car insurance</a>, <a href=\"http://www.outsurance.co.za/personal/contents-insurance/?source=iafrica&cr=dl\" target=\"_blank\">home insurance</a>,<br> <a href=\"http://www.outsurance.co.za/business/insurance/?source=iafrica&cr=dl\" target=\"_blank\">business insurance</a> and NOW <a href=\"http://www.outsurance.co.za/life/insurance/?source=iafrica&cr=dl\" target=\"_blank\">life insurance</a>. </div> </div>");	
        var adhtm = '<div style="float: right; margin-top: 3px;"><a href="http://s0b.bluestreak.com/ix.e?hr&s=7974597" target="_blank"><img src="http://s0b.bluestreak.com/ix.e?ir&s=7974597" border=0 alt=""></a></div>';

        $(".widget_weatherLink").before(adhtm);    

	hide_content(1, 3);
	hide_content(4, 6);
	
	setuserBlock("MR", "c_userBlock_tag1", 1);
	setuserBlock("F", "c_userBlock_tag4", 2);
	
	//tmout_tab[1] = setTimeout("fade_next(1)", v_timeout_tab);
	//tmout_tab[2] = setTimeout("fade_next(2)", v_timeout_tab);
	
	$("#c_userBlock_holder").mouseover(function() { clearTimeout(tmout_tab[1]); });
	$("#c_userBlock_holder").mouseleave(function() { tmout_tab[1] = setTimeout("fade_next(1)", v_timeout_tab); });
	
	$("#c_userBlock_holder2").mouseover(function() { clearTimeout(tmout_tab[2]); });
	$("#c_userBlock_holder2").mouseleave(function() { tmout_tab[2] = setTimeout("fade_next(2)", v_timeout_tab); });
	
	ua = navigator.userAgent.toLowerCase();
	ie6 = (ua.indexOf("msie") && document.all && ua.indexOf("netscape") == -1);
	nnf = (ua.indexOf("netscape") != -1 && ua.indexOf("gecko") != -1);
	nni = (ua.indexOf("netscape") != -1 && ua.indexOf("msie") != -1);
	nn6 = (ua.indexOf("netscape") != -1);
	gek = (ua.indexOf("gecko") != -1);
	ff1 = (ua.indexOf("firefox") != -1);
	opr = (ua.indexOf("opera") != -1);
	mac = (ua.indexOf("mac") != -1);
	web = (ua.indexOf("webtv") != -1);
	saf = (ua.indexOf("safari") != -1);
	kon = (ua.indexOf("konqueror") != -1);
	chr = (ua.indexOf("chrome") != -1);
	nn4 = (document.layers);

	if (chr || saf) {
		$("#interstitial").css("background", "red");
	}
});

// </tab boxes rotation scripts>



//////////////////////////////// rotate main articles
function initialise_rotateTopStories(){
myprogressTime = "";
//numSecs = 15000;
numProg= 200;
topStories = new Array("topContainer1","topContainer2","topContainer3","topContainer4");
topCurrent = 0;
rotateTopStories(1);
//mytopTime = setInterval(rotateTopStories,numSecs);
}

function rotateTop(direction){
//clearInterval(mytopTime);
switch(direction){
case 0:
clearInterval(myprogressTime);
break;
case 1:
topCurrent=topCurrent-1;
if(topCurrent<0){
topCurrent=topStories.length-1;
}
rotateTopStories(1);
//mytopTime = setInterval(rotateTopStories,numSecs);
restartProgress();
break;
case 2:
topCurrent=topCurrent+1;
if(topCurrent==topStories.length){
topCurrent=0;
}
rotateTopStories(1);
//mytopTime = setInterval(rotateTopStories,numSecs);
restartProgress();
break;
}

}
function rotateTopStories(automater){
if(!automater){
topCurrent=topCurrent+1;
if(topCurrent>=topStories.length){
topCurrent=0;

}
}
for(i=0;i<topStories.length;i++){
document.getElementById(topStories[i]).style.display ="none";
}
document.getElementById(topStories[topCurrent]).style.display = "inline";
restartProgress();
}

function restartProgress(){
clearInterval(myprogressTime);
progressWidth=0;
myprogressTime = setInterval(setProgressBar,numProg);
}

function setProgressBar(){
progressWidth+=3;
document.getElementById("c_row1_MainRotatesProgressBar").style.width=progressWidth+"px";
if(progressWidth>=200){rotateTopStories();}
}

//////////////////////// set the nav items
// few intialising

function writeNav(){

////////////// start load xml
var p;
try {
  p = new XMLHttpRequest();
} catch (e) {
  p = new ActiveXObject("Msxml2.XMLHTTP");
}

var interactiveCount = 0;

function myfunc()
{

  if (p.readyState == 3) {
    interactiveCount++;
  }

  if (p.readyState != 4)
    return;

  if (p.responseXML) {   
    var str;
    try {
      var s = new XMLSerializer();
      var d = p.responseXML;
      str = s.serializeToString(d);
 
    } catch (e) {
      str = p.responseXML.xml;
    }
  //  document.getElementById("id2").firstChild.nodeValue = str;
/////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
var x2=p.responseXML.getElementsByTagName("navItems");
myNavHolder = new Array();
for (i=0;i<x2.length;i++)
{ 
myNavHolder[i] = new Array();
myNavHolder[i][0]=x2[i].getElementsByTagName("title")[0].childNodes[0].nodeValue;
myNavHolder[i][1]=x2[i].getElementsByTagName("url")[0].childNodes[0].nodeValue;
myNavHolder[i][2]=x2[i].getElementsByTagName("target")[0].childNodes[0].nodeValue;
myNavHolder[i][4]=x2[i].getElementsByTagName("theID")[0].childNodes[0].nodeValue;
var x21=x2[i].getElementsByTagName("subnavItems");
myNavHolder[i][3] = new Array();
for (a=0;a<x21.length;a++){
myNavHolder[i][3][a] = new Array();
myNavHolder[i][3][a][0]=x21[a].getElementsByTagName("title")[0].childNodes[0].nodeValue;
myNavHolder[i][3][a][1]=x21[a].getElementsByTagName("url")[0].childNodes[0].nodeValue;
myNavHolder[i][3][a][2]=x21[a].getElementsByTagName("target")[0].childNodes[0].nodeValue;
myNavHolder[i][3][a][4]=x21[a].getElementsByTagName("theID")[0].childNodes[0].nodeValue;
}
}

myNav = "<div>";
myNav+="<div id=\"nav_start\"></div>";

for(i=0;i<myNavHolder.length;i++){
myNav+="<div class=\"nav_bar\" onMouseOver=\"overNav("+myNavHolder[i][4]+");\" onMouseOut=\"checkNav("+myNavHolder[i][4]+");\" onClick=\"goURL('"+myNavHolder[i][1]+"');\" id=\"nav_"+myNavHolder[i][4]+"\">"+myNavHolder[i][0]+"</div>";
}
myNav+="<div id=\"favButton\"><a href=\"javascript:CreateBookmarkLink();\"><img src=\"/pics/pics_rev/icon_fav.png\" border=\"0\" style=\"float: left;\" /></a>";

myNav+="<!--[if IE]>";
myNav+="<a href= \"javascript:history.go(0);\" onClick=\"this.style.behavior='url(#default#homepage)';";
myNav+="this.setHomePage('http://www.iafrica.com');\"><img src=\"/pics/pics_rev/icon_home.png\" border=\"0\" style=\"float: left;\" /></a>";
myNav+="<![endif]-->";

myNav+="</div></div>";

for(i=0;i<myNavHolder.length;i++){
			myNav+="<div  id=\"subnav_"+myNavHolder[i][4]+"\" style=\"display:none;\">";
			myNav+="<div class=\"subnav\" onMouseOver=\"overSubNav();\" onMouseOut=\"checkNav("+myNavHolder[i][4]+");\">";
				var subLength = myNavHolder[i][3].length;
				for(a=0;a<subLength;a++){
					myNav+="<div id=\"subItem_"+myNavHolder[i][3][a][4]+"\" class=\"subnav_item\" onMouseOut=\"checkSubNavOut("+myNavHolder[i][3][a][4]+")\" onMouseOver=\"checkSubNav("+myNavHolder[i][3][a][4]+")\" onClick=\"goURL('"+myNavHolder[i][3][a][1]+"');\">"+myNavHolder[i][3][a][0]+"</div>";
				}
			myNav+="</div></div>";
}

document.getElementById("rightNav").innerHTML = myNav;

totolNavs = myNavHolder.length;
setMarker();
	
/////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////	
  }  
}
// p.onload would also work in Mozilla
p.onreadystatechange = myfunc;
try {
  // Needed for Mozilla if local file tries to access an http URL
  netscape.security.PrivilegeManager.enablePrivilege("UniversalBrowserRead");
} catch (e) {
  // ignore
}
p.open("GET", "/nav_xml_t1.xml");
p.send(null);

////////////// end load xml
}


mynavTime = "";

/////////////////////////////////////////////// nav rollovers
function checkNav(theItem){
activeNav = theItem;
mynavTime = window.setInterval(navOut,1000);
}

function overNav(theItem){
//cancel old
if(theMarker!="") {
document.getElementById("subnav_"+theMarker).style.display = "none";
}
if(mynavTime!=""){

clearInterval(mynavTime);
for(i=0;i<totolNavs;i++){
var tempItem = "nav_"+ myNavHolder[i][4];
document.getElementById(tempItem).className="nav_bar";
var setSub = "subnav_"+myNavHolder[i][4];
document.getElementById(setSub).style.display = "none";
}
var subItem = "subnav_"+theItem;
var navItem = "nav_"+theItem;
document.getElementById(navItem).className="nav_bar";
document.getElementById(subItem).style.display = "none";
if(document.getElementById("subnav_extras")){
document.getElementById("subnav_extras").style.display = "inline";
}
}
// set new
var setOver = "nav_"+theItem;
var setSub = "subnav_"+theItem;
document.getElementById(setOver).className="nav_bar_over";
document.getElementById(setSub).style.display = "inline";
if(document.getElementById("subnav_extras")){
document.getElementById("subnav_extras").style.display = "none";
}
}

function navOut(){
for(i=0;i<totolNavs;i++){
var tempItem = "nav_"+ myNavHolder[i][4];
document.getElementById(tempItem).className="nav_bar";
var setSub = "subnav_"+myNavHolder[i][4];
document.getElementById(setSub).style.display = "none";
}
var setSub = "subnav_"+activeNav;
var setNav = "nav_"+activeNav;
document.getElementById(setNav).className="nav_bar";
document.getElementById(setSub).style.display = "none";
if(document.getElementById("subnav_extras")){
document.getElementById("subnav_extras").style.display = "inline";
}
clearInterval(mynavTime);

setMarker();
}

function setMarker(){
if(theMarker!="") {
document.getElementById("nav_"+theMarker).className="nav_bar_over";
document.getElementById("subnav_"+theMarker).style.display = "inline";
if(document.getElementById("subnav_extras")){
document.getElementById("subnav_extras").style.display = "none";
}
}

if(theSubMarker!="") {
document.getElementById("subItem_"+theSubMarker).className="subnav_item_over";
}
}

function checkSubNav(theMarked){
document.getElementById("subItem_"+theMarked).className="subnav_item_over";
}
function checkSubNavOut(theMarked){
document.getElementById("subItem_"+theMarked).className="subnav_item";
if(theSubMarker!="") {
document.getElementById("subItem_"+theSubMarker).className="subnav_item_over";
}
}

function overSubNav(){
if(mynavTime!=""){
clearInterval(mynavTime);
}
}

function goURL(theURL){
document.location.href = theURL;
}

function dynoFields(theTarget,searchText,setBack){
var checkItem = document.getElementById(theTarget).value;
if(checkItem == searchText){
 document.getElementById(theTarget).value = "";
}
if(setBack == "setBack"){
if(checkItem == "" || checkItem == " "){
 document.getElementById(theTarget).value = searchText;
}
}
}

// added 31/04/2008
function showWeather(showLayer,showLink){ document.getElementById("wcape").style.display = "none"; document.getElementById("wdbn").style.display = "none"; document.getElementById("wjhb").style.display = "none";
 document.getElementById("wlcape").className = ''; document.getElementById("wldbn").className = ''; document.getElementById("wljhb").className ='';
 document.getElementById(showLink).className = "blueUnder"; document.getElementById(showLink).blur(); 
 document.getElementById(showLayer).style.display = "inline"; setCookie('iWeather',showLayer,365);}

function initiateWeather(){iWeather=getCookie('iWeather');if (iWeather!=null && iWeather!=""){}else{iWeather = "wcape";}
if(iWeather=="wcape"){ showWeather('wcape','wlcape'); } else if(iWeather=="wdbn"){ showWeather('wdbn','wldbn'); } else if(iWeather=="wjhb"){ showWeather('wjhb','wljhb');}}


function MM_jumpMenuGo(objId,targ,restore){ //v9.0
  var selObj = null;  with (document) { 
  if (getElementById) selObj = getElementById(objId);
  if (selObj) eval(targ+".location='"+selObj.options[selObj.selectedIndex].value+"'");
  if (restore) selObj.selectedIndex=0; }
}




function spawn_window(content,spawn,sizing)
{window.open(content,spawn,sizing);}



function getCookie(c_name)
{
if (document.cookie.length>0)
  {
  c_start=document.cookie.indexOf(c_name + "=");
  if (c_start!=-1)
    { 
    c_start=c_start + c_name.length+1; 
    c_end=document.cookie.indexOf(";",c_start);
    if (c_end==-1) c_end=document.cookie.length;
    return unescape(document.cookie.substring(c_start,c_end));
    } 
  }
return "";
}

function setCookie(c_name,value,expiredays)
{var exdate=new Date();exdate.setDate(exdate.getDate()+expiredays);
document.cookie=c_name+ "=" +escape(value)+
((expiredays==null) ? "" : ";expires="+exdate.toGMTString());
}



function startPopEvent(PopEvent)
  {
    var desktop=window.open(PopEvent,"_blank","toolbar=yes,location=yes,status=yes,menubar=yes,scrollbars=yes,width=600,height=350,resizable");
  }



function startPop(PopEvent)
  {
    var desktop=window.open(PopEvent,"_blank","toolbar=yes,location=yes,status=yes,menubar=yes,scrollbars=yes,width=500,height=350,resizable");
  }


 function doIt()
 {
  window.open('http://www.iafrica.com/pls/cms/sharenet_search?sname='+document.form1.sname.value+'&fcode='+document.form1.fcode.value.toUpperCase());
 }
 
digg_bgcolor = '#fff';
digg_skin = 'icon';
digg_window = 'new';



/// set homepage

function CreateBookmarkLink() {
title = "iafrica.com";
url = "http://www.iafrica.com/";
if (window.sidebar) {
// Mozilla Firefox Bookmark
alert("adding a bookmark to FIREFOX!");
window.sidebar.addPanel(title, url,"");
} else if( window.external ) {
// IE Favorite
alert("adding a bookmark to Internet Explorer");
window.external.AddFavorite( url, title);
}
else if(window.opera && window.print) {
// Opera Hotlist
return true; 
}else { // for Safari, Konq etc - browsers who do not support bookmarking scripts (that i could find anyway)  
              alert('Unfortunately, this browser does not support the requested action,'  
              + ' please bookmark this page manually.');  
         }  


}



var win = null;
function NewWindow(mypage,myname,w,h,scroll){
LeftPosition = (screen.width) ? (screen.width-w)/2 : 0;
TopPosition = (screen.height) ? (screen.height-h)/2 : 0;
settings =
'height='+h+',width='+w+',top='+TopPosition+',left='+LeftPosition+',scrollbars='+scroll+',resizable'
win = window.open(mypage,myname,settings)
}







