var ie5 = (document.getElementById && document.all); 

var ns6 = (document.getElementById && !document.all);



var timerID = null;

var opak = 0;

var index = 0;

var mouseX = 5;

var mouseY = 20;





var msg = new Array();

msg[0]="";

msg[1]="My country is the world. <br> My countrymen are mankind. <br> -- Thomas Paine";

msg[2]="I am not an Athenian or a Greek, but a citizen of the world.-- Socrates";

msg[3]="Oh People, We created you equal from<br> the union of a pair, male and female,<br> and We made you races and tribes <br> to get to be acquainted <br> and cooperate with each other. <br> -- Qur'an (49:13)";

msg[4]="We pray for all mankind. <br> Though divided into nations and races, <br> yet we all are Thy children, <br> drawing from Thee our life and being.";

msg[5]="Nationalism is an infantile sickness. It is the measles of the human race. <br> -- Einstein";

msg[6]="All we are is the result of what we have thought.<br> If a man speaks or acts with an evil thought,<br> pain pursues him as the wheel of a wagon<br> follows the hoof of the ox that draws it.<br> If a man speaks or acts with a pure thought, happiness pursues him like his own shadow.";

msg[7]="The One they call by endless names <br> They call it Indra, Mitra, Varuna, Agni, <br> and he is heavenly nobly-winged Garutman.<br> To what is One,<br> sages give many a title <br> they call it Agni, Yama, Matarisvan.<br>  -- Rig Veda 1.164.46";

msg[8]="";

msg[9]="";





function changeMsg(index){

	if(ie5){

		obj.style.filter="blendTrans(Duration=1.2)";

		obj.filters[0].Apply();

		obj.style.visibility = "visible";

		obj.filters[0].Play();

		obj.innerHTML = msg[index];

	}

	else if(ns6){

		obj.style.visibility = "visible";

		obj.innerHTML = msg[index];

	}

}



function hideMsg(){

	if(ie5 || ns6){

		obj.style.visibility="hidden";

	}

}



function getMouseMove(e){

	if(ie5){

		obj.style.left = document.body.scrollLeft + event.clientX + mouseX;

		obj.style.top = document.body.scrollTop + event.clientY + mouseY;

	}

	else if(ns6){

		obj.style.left = window.pageXOffset + e.clientX + mouseX;

		obj.style.top = window.pageYOffset + e.clientY + mouseY;

	}

}



function fadingTooltipsInit(){

	if(ie5 || ns6){

		obj = document.getElementById('box');

		lnk = document.links;

		for(var i=0;i<lnk.length;i++){

			if(ie5){

				lnk[i].attachEvent("onmouseout", hideMsg);

			}

			else if(ns6){

				lnk[i].addEventListener("mouseout", hideMsg, false);

			}

		}

	}

}

document.onmousemove=getMouseMove;

onload=fadingTooltipsInit;

//////////////  Begin Contact Page ////////////////// 
//email address vaildation
function isValidEmail(theField) {
        if((getFront(theField.value,"@") != null) && (getEnd(theField.value,"@") != "") && (getEnd(theField.value,".") != "") && (getEnd(theField.value,".") != "")) {

            return true; 
        } else {
            return false; 
        }
    }
    
    
    function getFront(mainStr,searchStr){
        foundOffset = mainStr.indexOf(searchStr)
        if (foundOffset <= 0) {
            return null                        
        } 
        else {
            return mainStr.substring(0,foundOffset)
        }
    }
    
    
    function getEnd(mainStr,searchStr) {
        foundOffset = mainStr.indexOf(searchStr)
        if (foundOffset <= 0) {
            return ""   
        }
        else {
            return mainStr.substring(foundOffset+searchStr.length,mainStr.length)                       
        }
    }

	
//vaildate Contact Form
function submit_addCall(form) {
    
        foundError = false;  
		nameError = ""
        emailError = ""
		cityError = ""
		/*StateError = ""*/
		countryError = ""
		/*commentsError = ""*/

        if(form.name.value == "") {
            nameError = " - Name.\r";
            foundError = true;
        }

        if(form.email.value == "") {
            emailError = " - Email.\r";
            foundError = true;
        } 
        
        if((emailError == "") && (isValidEmail(form.email) == false)) { 
            emailError = " - VALID email address.\r";
            foundError = true;
        }
	
        if(form.city.value == "") {
            cityError = " - City.\r";
            foundError = true;
        }
		/*if(form.state.value == "") {
            stateError = " - State.\r";
            foundError = true;
        }
		*/
		if(form.country.value == "") {
            countryError = " - Country.\r";
            foundError = true;
        }
		/*if(form.commtxt.value == "") {
            commentsError = " - Comments.\r";
            foundError = true;
        }*/
	
      
        if(foundError == false) {
             return true;

        }else{ 
            errorMessage = "Please review the following information:\r\r" + nameError + emailError + cityError + countryError;
            alert (errorMessage)

            if (nameError != "") {
                form.name.focus()
                form.name.select()  
				emailError = "" 
				cityError = ""
				/*stateError = ""*/
				countryError = ""
				/*commentsError = ""*/
            }
            if (emailError != "") {
                form.email.focus()
                form.email.select()
				cityError = ""
				/*stateError = ""*/
				countryError = ""
				/*commentsError = ""*/

            }
		   if (cityError != "") {
                form.city.focus()
                form.city.select()
				/*stateError = ""*/
				countryError = ""
				/*commentsError = ""*/

            }
			/*
		   if (stateError != "") {
                form.state.focus()
                form.state.select()
		    	countryError = ""
		    	commentsError = ""

		   }
		   */
		   if (countryError != "") {
                form.country.focus()
                form.country.select()
				/*commentsError = ""*/

            }
            /*if (commentsError != "") {
                form.commtxt.focus()
                form.commtxt.select() 
            }*/
            return false;                       
        }   
    }

//////////////  End Contact Page //////////////////