// JavaScript Document

function simplePreload()
{ 
  var args = simplePreload.arguments;
  document.imageArray = new Array(args.length);
  for(var i=0; i<args.length; i++)
  {
    document.imageArray[i] = new Image;
    document.imageArray[i].src = args[i];
  }
}
/// preloading
simplePreload(	'images/mo_play.gif',+
				'images/mo_win.gif',+
				'images/mo_claim.gif',+
				'images/mo_rules.gif',+
				'images/mo_register.gif',+
				'images/mo_contact.gif',+
				'images/mo_faq.gif',+
				'images/header_home.gif',+
				'images/header_how2play.gif',+
				'images/header_how2claim.gif',+
				'images/header_rules.gif',+
				'images/header_register.gif',+
				'images/header_faqs.gif',+
				'images/header_contactus.gif'); 


// mouseOver Action Image Switch
function imgSwitch(imgName, imgSrc) 
{
      document.images[imgName].src = imgSrc;
}
////////

/// popup //////////////////////////////////////////////////////////////////////////////////////////////////
function popme(mypage, myname, w, h, s) 
	{
		var winl = (screen.Width - w) / 2;
		var wint = (screen.height - h) / 2;
		winprops = 'height='+h+',width='+w+',top='+wint+',left='+winl+',scrollbars='+scroll+',resizable=false'
		win = window.open(mypage, myname, winprops)
		if (parseInt(navigator.appVersion) >= 4) { win.window.focus(); }
	}
	

////////////////////////////////////////////////////////////////////////////////////////////////////////////
// footer links
function BottomLinks()
	{

		var devider = '&nbsp;|&nbsp;'
		document.write('<a href="index.htm">Home</a>');
		document.write(devider);
		document.write('<a href="india.htm">India</a>');
		document.write(devider)
		document.write('<a href="Namibia.htm">Namibia</a>');
		document.write(devider)
		document.write('<a href="Consular.htm">Consular Services</a>');
		document.write(devider)
		document.write('<a href="bilateral.htm">Indo-Namibian Relations</a>');
		document.write(devider)
		document.write('<a href="information-act.htm">Right To Information Act</a>');
		document.write(devider)
		document.write('<a href="education-training.htm"> Education and Training</a>');
		document.write(devider)
		document.write('<a href="happenings.html">Happenings</a>');
		document.write(devider)
		document.write('<a href="contactUs.htm">Contact Us</a>');
		document.write(devider)
		document.write('<a href="bilateral.htm" onclick=popme("disclaimer.htm","Disclaimer","500","80")>Disclaimer</a>');	
		document.write('<br><br>');
		document.write('<b><font face="Verdana, Arial, Helvetica, sans-serif" size="1" color="#333333">Copyright&nbsp;&copy;&nbsp;2005</font></b><br>')
		
	}

// contact us
	var h = '::::: PLEASE NOTE :::::::::::::::::::::::::::::::::::::::::::::::::::::::::::\n\n'
	var b = '\n\n::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::'
	
	function onContact(){

	var dc = document.contact
	
 		if(dc.bname.value==''||dc.surname.value=='' )
		{
		alert(h + 'Please enter a Contact Persons name.' + b)
		dc.bname.focus();
		}
		else if(dc.message.value == '')
		{
		alert(h + 'Please enter a Message.' + b)
		dc.message.focus();	
		}
		else if(dc.areacode.value == '')
		{
		alert(h + 'Please enter your areacode .' + b)
		dc.areacode.focus();
		}
		else if(dc.phone.value == '')
		{
		alert(h + 'Please enter a phone number.' + b)
		dc.phone.focus();
		}
		else if(dc.email.value=='')
		{
		alert(h + 'Please enter your e-mail address.' + b)
		dc.email.focus();
		}
		else if(dc.email.value.indexOf('@',0)==-1 || dc.email.value.indexOf('.',0)==-1)
		{
		alert(h + 'Please enter a valid e-mail address.' + b)
		dc.email.select();
		}else
		{
		if(confirm(h + "Are you sure you want to Send this Message ?" + b)){
		dc.submit();
		}
		}
		
		}

	

