/*
*************************************************
* Function used by different pages on the site. *
* Includes navigation and DHTML functions.      *
* Do not alter below this line.                 *
*************************************************
*/
function MM_findObj(n, d) {
    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); return x;
    }
function MM_swapImage() {
    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 MM_swapImgRestore() {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 openWindow(URL,name,features) {window.open(URL,name,features);}
function MM_preloadImages() {
    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 showlayer(lname) {
    //document.imgselect.src='images/downloadcenter/box_download_'+lname+'.gif';
    document.getElementById("sms").style.display = 'none';
    document.getElementById("email").style.display = 'none';
    document.getElementById("mobile").style.display = 'none';
    document.getElementById("iphone").style.display = 'none';
    document.getElementById(lname).style.display = 'block';
    document.getElementById("bottom_link").style.display = 'block';
    }
function showlayer2(lname) {
    document.imgselect.src='images/downloadcenter/box_download_'+lname+'2.gif';
    document.getElementById("sms").style.display = 'none';
    document.getElementById("email").style.display = 'none';
    document.getElementById("mobile").style.display = 'none';
    document.getElementById(lname).style.display = 'block';
    }
function showlayer_3(lname) {
    document.getElementById("bottom_link").style.display = 'none';
    }
function wm_showlayer(lname) {
    document.imgselect.src='images/downloadcenter/'+lname+'_top_bg.gif';
    document.getElementById("wmlive").style.display = 'none';
    document.getElementById("wm").style.display = 'none';
    document.getElementById(lname).style.display = 'block';
    }
function wml_showlayer(lname) {
    document.getElementById("wml_box_one").style.display = 'none';
    document.getElementById("wml_box_two").style.display = 'none';
    document.getElementById("wml_box_three").style.display = 'none';
    document.getElementById(lname).style.display = 'block';
    }
function features_showlayer(mname,lname,service,len,srv_name,srv_list) {
	for (i=1;i<=len;i++) document.getElementById("features"+[i]).style.display = "none";
	document.getElementById(service).style.display = 'block';
	
	for (i=1;i<=len-1;i++) document.getElementById("menu"+[i]).innerHTML = '<div id="link'+[i]+'" class="feature_service" align="left" onMouseOut="this.className=\'feature_service\'" onMouseOver="this.className=\'feature_service_over\'"onclick="features_showlayer(\'menu'+[i]+'\',\'link'+[i]+'\',\'features'+[i]+'\','+len+',\''+srv_list[i-1]+'\',srv_list);"><div style="padding-left:15px;padding-top:8px;">'+srv_list[i-1]+'</div></div>';
	
	document.getElementById("menu"+[len]).innerHTML = '<div id="link'+[len]+'" class="feature_btmservice" align="left" onMouseOut="this.className=\'feature_btmservice\'" onMouseOver="this.className=\'feature_btmservice_over\'" onclick="features_showlayer(\'menu'+[len]+'\',\'link'+[len]+'\',\'features'+[len]+'\','+len+',\''+srv_list[len-1]+'\',srv_list);"><div style="padding-left:15px;padding-top:8px;">'+srv_list[len-1]+'</div></div>';
	
	document.getElementById(mname).innerHTML = '<div id="'+lname+'" class="feature_service_down" align="left"><div style="padding-left:15px;padding-top:8px;">'+srv_name+'</div></div>';
	}
function imgchange(id,img) {
	document.getElementById(id).style.backgroundImage = img;
	}
function show_video(id) {
    document.getElementById("video_1").style.display = 'none';
    document.getElementById("video_2").style.display = 'none';
    document.getElementById("video_3").style.display = 'none';
    document.getElementById("video_4").style.display = 'none';
    document.getElementById('video_'+id).style.display = 'block';
    }
function gup( name ){  
	name = name.replace(/[\[]/,"\\\[").replace(/[\]]/,"\\\]");  
	var regexS = "[\\?&]"+name+"=([^&#]*)";  
	var regex = new RegExp( regexS );  
	var results = regex.exec( window.location.href );  
	if( results == null )    
	return "";
	else
	return results[1];
    }
function confirm_redir(){
    if(document.message_confirm.msgconfirm[0].checked){
	    window.location.href='/downloadcenter/install.php?prn='+gup('prn');
		}
	else {document.getElementById('error').style.display = 'block';}
	}
function MM_openBrWindow(theURL,winName,features) {window.open(theURL,winName,features);}
function dc_show_wml_box(){
    document.wm_bar.src='images/downloadcenter/wm_box_wm_bar.gif';
    document.wml_bar.src='images/downloadcenter/wm_box_wml_bar_arrow.gif';
    document.getElementById("dc_box_wm_wml").innerHTML = '<img src="images/downloadcenter/WML_podanim4.gif" width="188" height="142" border="0" align="left" hspace="30"><br><span class="subheader">Ready to simplify your travel?</span><br><br>Have a BlackBerry or a Windows Mobile device?<br><a href="/downloadcenter/download.php?prn=WorldMate Live&pc=1"><img src="images/downloadcenter/getworldmatelive_btn.jpg" width="166" height="33" border="0" vspace="7"></a><br>Have a different smartphone? <a href="#" style="color:#009EBF; font-weight:bold;" onClick="dc_show_wm_box();">Click here &gt;</a>';
    }
function dc_show_wm_box(){
    document.wm_bar.src='images/downloadcenter/wm_box_wm_bar_arrow.gif';
    document.wml_bar.src='images/downloadcenter/wm_box_wml_bar.gif';
    document.getElementById("dc_box_wm_wml").innerHTML = '<img src="images/downloadcenter/wm_podanim.gif" width="138" height="155" border="0" align="left" hspace="40">Think of it as your personal travel assistent -<br>all the tools you need when you\'re on the road.<br><br>Have a Symbian or Palm OS smartphone?<br><a href="/downloadcenter/download.php?prn=WorldMate"><img src="images/downloadcenter/getworldmate_btn.jpg" width="152" height="45" border="0" vspace="4"></a><br>Have a BlackBerry or Windows Mobile device?<br><a href="#" style="color:#009EBF; font-weight:bold;" onClick="dc_show_wml_box();">Click here &gt;</a>';
    }
function show_hide_support_pasword(id) {
	if(id=='Cancellation'){
    document.getElementById("password").style.display = 'block';
	document.getElementById("password2").style.display = 'block';
	}else{
    document.getElementById("password").style.display = 'none';
	document.getElementById("password2").style.display = 'none';}
    }
function show_hide_purchase_route(id) {
	if(id=='-- Please Choose --'){
		document.getElementById("reference_no").style.display = 'none';
		document.getElementById("reference_no2").style.display = 'none';
		document.getElementById("activation_code").style.display = 'none';
		document.getElementById("activation_code2").style.display = 'none';
    }else{
		document.getElementById("reference_no").style.display = 'block';
		document.getElementById("reference_no2").style.display = 'block';
		document.getElementById("activation_code").style.display = 'block';
		document.getElementById("activation_code2").style.display = 'block';
	}
}
function show_hide_platform(id) {
	if(id=='WinMob'){
		document.getElementById("winmob_application").style.display = 'block';
		document.getElementById("palm_application").style.display = 'none';
		document.getElementById("symbian_application").style.display = 'none';
	}else{
		if(id=='Palm'){
			document.getElementById("winmob_application").style.display = 'none';
			document.getElementById("palm_application").style.display = 'block';
			document.getElementById("symbian_application").style.display = 'none';
		}else{
			
			if(id=='Symbian'){
				document.getElementById("winmob_application").style.display = 'none';
				document.getElementById("palm_application").style.display = 'none';
				document.getElementById("symbian_application").style.display = 'block';
		
			}else{
				document.getElementById("winmob_application").style.display = 'none';
				document.getElementById("palm_application").style.display = 'none';
				document.getElementById("symbian_application").style.display = 'none';
			}
			
		}
    }
}
/*************************************** HOME PAGE ******************************************************************/
function show_home_video(id)
{
		var movieDiv = document.getElementById('videoContainer');
		var content='';
		if(id==1) {
			content= ' <div id="videoTitle" class="blue_txt" align="left" style="padding-bottom:30px;padding-left:5px;">'
                     +'<div style=" float:left;padding-left:5px;"><img src="images/homepage/movieIconBig.gif"></div>'
                     +'<div class="title_home">The Cancelled Flight</div>'
					 +'</div>'
					+'<object width="220" height="178">'
					+'<param name="movie" value="http://www.youtube.com/v/p36sGK1_QhU&hl=en">'
					+'<param name="wmode" value="transparent"><embed src="http://www.youtube.com/v/p36sGK1_QhU&hl=en" type="application/x-shockwave-flash" wmode="transparent" width="220" height="178"></embed></object>'
					+'<table cellpadding="0" cellspacing="0" border="0" style="padding-top:10px;padding-bottom:7px;padding-left:15px;" align="left">'
                                    +'<tr align="left">'
                                       +' <td align="left" valign="middle" width="13"><a href="JavaScript:void(0)" onClick="show_home_video(2);"><img src="images/homepage/movieIconSmall.gif" border="0"></a></td><td align="left" style="padding-left:2px;padding-right:6px;"><a href="JavaScript:void(0)" onClick="show_home_video(2);" class="video_txt">Lost in Paris</a></td>'
                                        +'<td align="left" valign="middle" width="13"><a href="JavaScript:void(0)" onClick="show_home_video(3);"><img src="images/homepage/movieIconSmall.gif" border="0"></a></td><td align="left" style="padding-left:2px;padding-right:6px;"><a href="JavaScript:void(0)" onClick="show_home_video(3);" class="video_txt">Flight Rush</a></td>'
                                   +' </tr>'
                                +'</table>';
		} else if(id==2){
			content=' <div id="videoTitle" class="blue_txt" align="left" style="padding-bottom:30px;padding-left:5px;">'
                     +'<div style=" float:left;padding-left:5px;"><img src="images/homepage/movieIconBig.gif"></div>'
                     +'<div class="title_home">Lost in Paris</div>'
					 +'</div>'
					 +'<object width="220" height="178"><param name="movie" value="http://www.youtube.com/v/drg47MaH4ec&hl=en"><param name="wmode" value="transparent"><embed src="http://www.youtube.com/v/drg47MaH4ec&hl=en" type="application/x-shockwave-flash" wmode="transparent" width="220" height="178"></embed></object>'
					 +'<table cellpadding="0" cellspacing="0" border="0" style="padding-top:10px;padding-bottom:7px;padding-left:15px;" align="left">'
                                    +'<tr align="left">'
                                       +'<td align="left" valign="middle" width="13"><a href="JavaScript:void(0)" onClick="show_home_video(1);"><img src="images/homepage/movieIconSmall.gif" border="0"></a></td><td align="left" style="padding-left:2px;padding-right:6px;"><a href="JavaScript:void(0)" onClick="show_home_video(1);" class="video_txt">Cancelled Flight</a></td>'
                                        +'<td align="left" valign="middle" width="13"><a href="JavaScript:void(0)" onClick="show_home_video(3);"><img src="images/homepage/movieIconSmall.gif" border="0"></a></td><td align="left" style="padding-left:2px;padding-right:6px;"><a href="JavaScript:void(0)" onClick="show_home_video(3);" class="video_txt">Flight Rush</a></td>'
                                   +' </tr>'
                                +'</table>';
		} else if(id==3){
			content=' <div id="videoTitle" class="blue_txt" align="left" style="padding-bottom:30px;padding-left:5px;">'
                     +'<div style=" float:left;padding-left:5px;"><img src="images/homepage/movieIconBig.gif"></div>'
                     +'<div class="title_home">Flight Rush</div>'
					 +'</div>'
					 +'<object width="220" height="178"><param name="movie" value="http://www.youtube.com/v/GfM5xTVg5K8&hl=en"><param name="wmode" value="transparent"><embed src="http://www.youtube.com/v/GfM5xTVg5K8&hl=en" type="application/x-shockwave-flash" wmode="transparent" width="220" height="178"></embed></object>'
					 +'<table cellpadding="0" cellspacing="0" border="0" style="padding-top:10px;padding-bottom:7px;padding-left:15px;" align="left">'
                                    +'<tr align="left">'
                                       +' <td align="left" valign="middle" width="13"><a href="JavaScript:void(0)" onClick="show_home_video(1);"><img src="images/homepage/movieIconSmall.gif" border="0"></a></td><td align="left" style="padding-left:2px;padding-right:6px;"><a href="JavaScript:void(0)" onClick="show_home_video(1);" class="video_txt">Cancelled Flight</a></td>'
                                        +'<td align="left" valign="middle" width="13"><a href="JavaScript:void(0)" onClick="show_home_video(2);"><img src="images/homepage/movieIconSmall.gif" border="0"></a></td><td align="left" style="padding-left:2px;padding-right:6px;"><a href="JavaScript:void(0)" onClick="show_home_video(2);" class="video_txt">Lost in Paris</a></td>'
                                   +' </tr>'
                                +'</table>';
		}
		movieDiv.innerHTML = content;
		movieDiv.style.display = "block";
}

function menu_over(obj) {
		if (document.images != null) {
			for (i=0;i<=9;i++) document.getElementById("menu"+[i]).style.backgroundImage = "none";
			obj.style.backgroundImage = "url('images/homepage/menuSel1.gif')";
		}
}

function menu_out(obj) {
		if (document.images != null) {
			for (i=1;i<=9;i++) document.getElementById("menu"+[i]).style.backgroundImage = "none";
			obj.style.backgroundImage = "url('images/homepage/menuSel1.gif')";
		}
}

function menu_over_1(obj) {
		if (document.images != null) {
			document.getElementById(obj.id+"_1").style.color = "#d2d2d2";
		}
}

function menu_out_1(obj) {
		if (document.images != null) {
			document.getElementById(obj.id+"_1").style.color = "";
		}
}

function show_image(id) {
		var imageDiv = document.getElementById('imageContainer');
		var content='';
		if(id==0) {
					
			content='<table cellpadding="0" cellspacing="0" border="0"><tr><td valign="top"><img src="images/homepage/Image_ref01.jpg" usemap="#Map" border="0"></td></tr></table>';
			
			} else if(id==1){
			content='<table cellpadding="0" cellspacing="0" border="0"><tr><td valign="bottom"><img src="images/homepage/Image_ref1.jpg" usemap="#Map" border="0"></td></tr></table>';
		} else if(id==2){
			content='<table cellpadding="0" cellspacing="0" border="0"><tr><td valign="bottom"><img src="images/homepage/Image_ref2.jpg" usemap="#Map" border="0"></td></tr></table>';
		} else if(id==3){
			content='<table cellpadding="0" cellspacing="0" border="0" height="349"><tr><td valign="bottom"><img src="images/homepage/Image_ref3.jpg" usemap="#Map" border="0"></td></tr></table>';
		} else if(id==4) {
			content='<table cellpadding="0" cellspacing="0" border="0"><tr><td valign="bottom"><img src="images/homepage/Image_ref4.jpg" usemap="#Map" border="0"></td></tr></table>';
		} else if(id==5) {
			content='<table cellpadding="0" cellspacing="0" border="0"><tr><td valign="bottom"><img src="images/homepage/Image_ref9.jpg" usemap="#Map" border="0"></td></tr></table>';
		}
		
		 else if(id==6) {
			content='<table cellpadding="0" cellspacing="0" border="0"><tr><td valign="bottom"><img src="images/homepage/Image_ref6.jpg" usemap="#Map" border="0"></td></tr></table>';
		} else if(id==7) {
			content='<table cellpadding="0" cellspacing="0" border="0"><tr><td valign="bottom"><img src="images/homepage/Image_ref7.jpg" usemap="#Map" border="0"></td></tr></table>';
		} else if(id==8) {
			content='<table cellpadding="0" cellspacing="0" border="0"><tr><td valign="bottom"><img src="images/homepage/Image_ref8.png" usemap="#Map" border="0"></td></tr></table>';
		}else if(id==9) {
			content='<table cellpadding="0" cellspacing="0" border="0"><tr><td valign="bottom"><img src="images/homepage/Image_ref10.jpg" usemap="#Map" border="0"></td></tr></table>';
		}
		
		imageDiv.innerHTML = content;
}

function checkHost() {

		var u = document.location.href;
		var strQS = "";
		if ( u.indexOf("?") > -1 ){
			var strQS = u.substr(u.indexOf("?"));
		}
		if(u.indexOf("<?php echo $mmHost; ?>/")!=0) {
			document.location.href = "<?php echo $mmHost; ?>/"+strQS;
		}
}
/*************************************** END HOME PAGE ******************************************************************/
