// JavaScript Document
mnu_supr = null;
mnu_supm = null;
er_cachebust = 1;
pr_cachebust = "";

function loadCntr() {
	MM_preloadImages('src/m00b.gif','src/m01b.gif','src/m02b.gif','src/m03b.gif','src/m04b.gif','src/m05b.gif','src/m06b.gif','src/m07b.gif','src/m08b.gif','src/m09b.gif','src/m10b.gif')
	document.getElementById("mainBanner").style.visibility = "visible";
	mnu_act(document.getElementById("m0"),'0');
	megaburst('sys/index0m.html');
}

function erFormSub() {
	_qa = document.getElementById('firstname').value;
	_qb = document.getElementById('lastname').value;
	_qc = document.getElementById('country').value;
	_qd = document.getElementById('address').value;
	_qe = document.getElementById('contact').value;
	_qf = document.getElementById('email').value;
	_qg = document.getElementById('inquiry').value;
	dLoad_f = '<table bgcolor="#FFFFFF" align="center" width="500" height="325" border="0" cellpadding="0" cellspacing="0"><tr><td valign="middle" align="center"><img src="images/loading.gif" width="32" height="32" border="0"><br &nbsp;<br>submitting your feedback...</td></tr></table>';
	kuSubSec_F = false;
	if (window.XMLHttpRequest) kuSubSec_F = new XMLHttpRequest();
	else if (window.ActiveXObject) {
		try { kuSubSec_F = new ActiveXObject("Msxml2.XMLHTTP"); } 
		catch (e) {
			try { kuSubSec_F = new ActiveXObject("Microsoft.XMLHTTP"); }
			catch (e) {}
		}
	}
	else return false;
	document.getElementById("megacp").innerHTML = dLoad_f;
	kuSubSec_F.onreadystatechange = function() {
		kuFormKlutter(kuSubSec_F);
	}
	kuSubSec_F.open('POST', 'src/cntsub.php');
	kuSubSec_F.setRequestHeader('Content-Type', 'application/x-www-form-urlencoded');
	kuSubSec_F.send('fn='+_qa+'&ln='+_qb+'&cn='+_qc+'&ad='+_qd+'&ct='+_qe+'&em='+_qf+'&iq='+_qg);
}

function kuFormKlutter(_kuSubSec_F) {
	if (_kuSubSec_F.readyState == 4 && (_kuSubSec_F.status == 200 || window.location.href.indexOf("http") == -1)) {
		document.getElementById("megacp").innerHTML = 'Thank you for your feedback.';
		setTimeout("megaburst('sys/index0m.html')",3500);
		return;
	}
}
function erReqSub() {
	_rQa = document.getElementById('title').value;
	_rQb = document.getElementById('givenname').value;
	_rQc = document.getElementById('familyname').value;
	_rQd = document.getElementById('address_a').value;
	_rQe = document.getElementById('address_b').value;
	_rQf = document.getElementById('address_c').value;
	_rQg = document.getElementById('city').value;
	_rQh = document.getElementById('state').value;
	_rQi = document.getElementById('country').value;
	_rQj = document.getElementById('postalcode').value;
	_rQk = document.getElementById('telephone').value;
	_rQl = document.getElementById('email').value;
	_rQm = document.getElementById('noofnights').value;
	_rQn = document.getElementById('adults').value;
	_rQo = document.getElementById('childunder2').value;
	_rQp = document.getElementById('two11years').value;
	_rQq = document.getElementById('twelve17years').value;
	_rQr = document.getElementById('arrivaldate').value;
	_rQs = document.getElementById('accomodation').value;
	_rQt = document.getElementById('inquiry').value;
	dLoad_f = '<table bgcolor="#FFFFFF" align="center" width="500" height="325" border="0" cellpadding="0" cellspacing="0"><tr><td valign="middle" align="center"><img src="images/loading.gif" width="32" height="32" border="0"><br &nbsp;<br>submitting your request to our server...</td></tr></table>';
	kuSubSec_F = false;
	if (window.XMLHttpRequest) kuRubSec_F = new XMLHttpRequest();
	else if (window.ActiveXObject) {
		try { kuRubSec_F = new ActiveXObject("Msxml2.XMLHTTP"); } 
		catch (e) {
			try { kuRubSec_F = new ActiveXObject("Microsoft.XMLHTTP"); }
			catch (e) {}
		}
	}
	else return false;
	document.getElementById("megacp").innerHTML = dLoad_f;
	kuRubSec_F.onreadystatechange = function() {
		kuReqKlutter(kuRubSec_F);
	}
	kuRubSec_F.open('POST', 'src/rqsub.php');
	kuRubSec_F.setRequestHeader('Content-Type', 'application/x-www-form-urlencoded');
	kuRubSec_F.send('a='+_rQa+'&b='+_rQb+'&c='+_rQc+'&d='+_rQd+'&e='+_rQe+'&f='+_rQf+'&g='+_rQg+'&h='+_rQh+'&i='+_rQi+'&j='+_rQj+'&k='+_rQk+'&l='+_rQl+'&m='+_rQm+'&n='+_rQn+'&o='+_rQo+'&p='+_rQp+'&q='+_rQq+'&r='+_rQr+'&s='+_rQs+'&t='+_rQt);
}

function kuReqKlutter(_kuRubSec_F) {
	if (_kuRubSec_F.readyState == 4 && (_kuRubSec_F.status == 200 || window.location.href.indexOf("http") == -1)) {
		document.getElementById("megacp").innerHTML = 'Thank you for your request, we will get back to you soon.';
		setTimeout("megaburst('sys/index0m.html')",3500);
		return;
	}
}

function photoblast(ph_url) {
	ph_blst = new Image();
	ph_blst.src = ph_url;
	document.getElementById("megacp").innerHTML = '<img src="images/loading.gif" width="32" height="32" border="0">';
	if (ph_blst.complete) {
		document.getElementById("megacp").innerHTML='<img id="bhPhImg" src="'+ph_blst.src+'" width="500" height="325" class="phBig">';
		opacity("bhPhImg", 0, 100, 200);
	} else {
		ph_blst.onload = function() {
			document.getElementById("megacp").innerHTML='<img id="bhPhImg" src="'+ph_blst.src+'" width="500" height="325" class="phBig">';
			opacity("bhPhImg", 0, 100, 200);
		}
	}
}

function startpg() {
	mnu_act(document.getElementById("m9"),"2");
	photoblast('src/pg/pg2.jpg');
}

function opacity(id, opacStart, opacEnd, millisec) { 
    //speed for each frame 
    var speed = Math.round(millisec / 100); 
    var timer = 0; 

    //determine the direction for the blending, if start and end are the same nothing happens 
    if(opacStart > opacEnd) { 
        for(i = opacStart; i >= opacEnd; i--) { 
            setTimeout("changeOpac(" + i + ",'" + id + "')",(timer * speed)); 
            timer++; 
        } 
    } else if(opacStart < opacEnd) { 
        for(i = opacStart; i <= opacEnd; i++) 
            { 
            setTimeout("changeOpac(" + i + ",'" + id + "')",(timer * speed)); 
            timer++; 
        } 
    } 
} 

//change the opacity for different browsers 
function changeOpac(opacity, id) { 
    var object = document.getElementById(id).style; 
    object.opacity = (opacity / 100); 
    object.MozOpacity = (opacity / 100); 
    object.KhtmlOpacity = (opacity / 100); 
    object.filter = "alpha(opacity=" + opacity + ")"; 
}
function megaburst(mg_url) {
	mega_cnnt = false;
	if (window.XMLHttpRequest) mega_cnnt = new XMLHttpRequest();
	else if (window.ActiveXObject) {
		try { mega_cnnt = new ActiveXObject("Msxml2.XMLHTTP"); } 
		catch (e) {
			try { mega_cnnt = new ActiveXObject("Microsoft.XMLHTTP"); }
			catch (e) {}
		}
	} else return false;
	document.getElementById("megacp").innerHTML = '<img src="images/loading.gif" width="32" height="32" border="0">';
	mega_cnnt.onreadystatechange = function() {
		megaspread(mega_cnnt);
	}
	if (er_cachebust) pr_cachebust = (mg_url.indexOf("?") != -1)? "&"+ new Date().getTime() : "?"+ new Date().getTime();
	mega_cnnt.open('GET', mg_url + pr_cachebust, true)
	mega_cnnt.send(null);
}

function microburst(mc_url) {
	micro_cnnt = false; _mph_hl=null;
	if (window.XMLHttpRequest) micro_cnnt = new XMLHttpRequest();
	else if (window.ActiveXObject) {
		try { micro_cnnt = new ActiveXObject("Msxml2.XMLHTTP"); } 
		catch (e) {
			try { micro_cnnt = new ActiveXObject("Microsoft.XMLHTTP"); }
			catch (e) {}
		}
	} else return false;
	document.getElementById("microcp").innerHTML = 'Loading data...';
	micro_cnnt.onreadystatechange=function(){microspread(micro_cnnt);}
	if (er_cachebust) pr_cachebust=(mc_url.indexOf("?") != -1)? "&"+ new Date().getTime() : "?"+ new Date().getTime();
	micro_cnnt.open('GET', mc_url, true)
	micro_cnnt.send(null);
}



function mnu_act(_spac,_spnc){
	if(mnu_supr){
		mnu_supr.src=mnu_supr.src.toString().substring(0,mnu_supr.src.toString().lastIndexOf(".")-1)+"a.gif";
	}
	if(mnu_supr==document.getElementById("m0")&&mnu_supm){
		mnu_supm.src=mnu_supm.src.toString().substring(0,mnu_supm.src.toString().lastIndexOf(".")-1)+"a.gif";
		mnu_supm=null;
	}
	mnu_supr=_spac;
	mnu_supr.src=mnu_supr.src.toString().substring(0,mnu_supr.src.toString().lastIndexOf(".")-1)+"b.gif";
	if(_spnc!="3"){microburst('sys/index'+_spnc+'.html');}else{document.getElementById("microcp").innerHTML="&nbsp;";};
}

function mnu_mnr(_spam,_spnm){
	if(mnu_supm){mnu_supm.src=mnu_supm.src.toString().substring(0,mnu_supm.src.toString().lastIndexOf(".")-1)+"a.gif";}
	mnu_supm=_spam;
	mnu_supm.src=mnu_supm.src.toString().substring(0,mnu_supm.src.toString().lastIndexOf(".")-1)+"b.gif";
	if(mnu_supr){mnu_supr.src=mnu_supr.src.toString().substring(0,mnu_supr.src.toString().lastIndexOf(".")-1)+"a.gif";}
	mnu_supr=document.getElementById("m0");
	mnu_supr.src="src/m00b.gif";
	microburst('sys/index'+_spnm+'.html');
}


_maldIve = null;
function maldIve(_hop,_hnp){
	if(_maldIve){_maldIve.style.color="#fffaf0";}
	_maldIve=_hop;_maldIve.style.color="#ebd198";
	m_arc = [
		["Maldives","Sun, sand and sea, a thousand 'Robinson Crusoe' islands, massive lagoons with different depths and infinite shades of blue and turquoise, dazzling underwater coral gardens; a perfect natural combination for the ideal tropical holiday destination. However there is more to the Maldives than just that."]
		,["Location","Southwest of Sri Lanka, on the equator."]
		,["Geography","1,190 coral islands, forming an archipelago of 26 major atolls. Stretches 820 kilometres north to south and 120 kilometres east to west. 202 are inhabited, 87 are exclusive resort islands."]
		,["Climate","Generally warm and humid. Sun shines all year through. Average temperature around 29 - 32 degrees Celsius. "]
		,["Culture","A proud history and rich culture evolved from the first settlers who were from various parts of the world travelling the seas in ancient times. The Maldives has been a melting pot of different cultures as people from different parts of the world came here and settled down. Some of the local music and dance for instance resemble African influences, with handbeating of drums and songs in a language that is not known to any but certainly represents that of East African countries. As one would expect there is a great South Asian influence in some of the music and dancing and especially in the traditional food of the Maldivians."]
		,["Language","Dhivehi is the language spoken in all parts of the Maldives. English is widely spoken by Maldivians and visitors can easily make themselves understood getting around the capital island. In the resorts, a variety of languages are spoken by the staff including English, German, French, Italian and Japanese. "]
		,["Currency","The Maldivian currency is the Rufiyaa and Laaree. The exchange rate for US Dollar at the time of writing is MRf.11.82 for the dollar. One Rufiyaa is equivalent to 100 laarees. Rufiyaa bank notes come in denominations of 5, 10, 20, 50, 100 and 500. Coins are in the denominations of MRf.2.00, MRf.1.00, 50 laarees, 20, 10, 5, 2 and 1 laaree. The US Dollar is the most commonly used foreign currency. Payments in the resorts and hotels can be made in most hard currency in cash, travellers' cheques or credit cards. Commonly used credit cards are American Express, Visa, Master Card, Diners Club, JCB and Euro Card. "]
		,["Male' the capital","Male' would certainly count as one of the smallest capitals in the world in terms of its physical size. A third of the country's population, about 75,000 live in Male'. Different from any other island in the country, Male' is a city of high-rise buildings and paved roads. While the government offices are located in one area, the main streets are lined with shops and offices. In the old bazaar area which still houses the country's hub of wholesale and retail trade, the lanes are so narrow that a single vehicle would find it difficult to navigate through, especially with its throngs of busy people."]
	];
	document.getElementById("mvHeadr").innerHTML = m_arc[_hnp][0];
	document.getElementById("mvCnt").innerHTML = m_arc[_hnp][1];
}
_mph_hl=null;


function megaspread(mega_cnnt){if(mega_cnnt.readyState==4&&(mega_cnnt.status==200||window.location.href.indexOf("http")==-1)){
document.getElementById("megacp").innerHTML=mega_cnnt.responseText;}}
function microspread(micro_cnnt){if(micro_cnnt.readyState==4&&(micro_cnnt.status==200||window.location.href.indexOf("http")==-1)){
document.getElementById("microcp").innerHTML=micro_cnnt.responseText;}}
function opacity(id,opacStart,opacEnd,millisec){var speed=Math.round(millisec/100);var timer=0;if(opacStart>opacEnd){
for(i=opacStart;i>=opacEnd;i--){setTimeout("changeOpac("+i+",'"+id+"')",(timer*speed));timer++;}}else if(opacStart<opacEnd){
for(i=opacStart;i<=opacEnd;i++){setTimeout("changeOpac("+i+",'"+id+"')",(timer*speed));timer++;}}} 
function changeOpac(opacity,id){var object=document.getElementById(id).style;object.opacity=(opacity/100);object.MozOpacity=(opacity/100);
object.KhtmlOpacity=(opacity/100);object.filter="alpha(opacity="+opacity+")";}
function mnu_hv(_maa){if(_maa!=mnu_supr){_maa.src=_maa.src.toString().substring(0,_maa.src.toString().lastIndexOf(".")-1)+"b.gif";}}
function mnu_ot(_mba){if(_mba!=mnu_supr){_mba.src=_mba.src.toString().substring(0,_mba.src.toString().lastIndexOf(".")-1)+"a.gif";}}
function mnu_vt(_mca){if(_mca!=mnu_supm){_mca.src=_mca.src.toString().substring(0,_mca.src.toString().lastIndexOf(".")-1)+"a.gif";}}
function mph_h(_mph){if(_mph!=_mph_hl){_mph.style.textDecoration="underline";_mph.style.color="#978E64";}}
function mph_o(_mph){if(_mph!=_mph_hl){_mph.style.textDecoration="none";_mph.style.color="#B7B093";}}
function mph_c(_mph,_phrl,_vmd){if(_mph_hl){_mph_hl.style.textDecoration="none";_mph_hl.style.color="#B7B093";}
_mph_hl=_mph;_mph_hl.style.textDecoration="underline";_mph_hl.style.color="#655f43";if(_vmd==1){
_mpch='<object classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" codebase="http://download.macromedia.com/pub/shockwave/ca';
_mpch+='bs/flash/swflash.cab#version=7,0,0,0" width="270" height="150" id="FLVPlayer"><param name="movie" value="FLVPlayer_Pr';
_mpch+='ogressive.swf"><param name="salign" value="lt"><param name="quality" value="high"><param name="scale" value="noscale"';
_mpch+='><param name="FlashVars" value="&MM_ComponentVersion=1&skinName=Clear_Skin_2&streamName=src/'+_phrl+'&autoPlay=true&';
_mpch+='autoRewind=true" /><embed src="FLVPlayer_Progressive.swf" flashvars="&MM_ComponentVersion=1&skinName=Clear_Skin_2&str';
_mpch+='eamName=src/'+_phrl+'&autoPlay=true&autoRewind=true" quality="high" scale="noscale" width="270" height="150" name="F';
_mpch+='LVPlayer" salign="LT" type="application/x-shockwave-flash" pluginspage="http://www.macromedia.com/go/getflashplayer">';
_mpch+='</embed></object>';}else{_mpch='<img src="src/'+_phrl+'" width="270" height="150">'}
document.getElementById('mp_dep').innerHTML=_mpch;}

