﻿// JScript File
 
    var hiddHomeObj=null;
     var hiddServicesObj=null;
     var hiddFaqObj=null;
     var hiddLinksObj=null;
     var hiddAboutObj=null;
     var hiddContactObj=null;
     
     function setUniqIdsAndData(hidHomeObj,hidServicesObj,hidFaqObj,hidLinksObj,hidAboutObj,hidContactObj)
    {
       hiddHomeObj=hidHomeObj;
       hiddServicesObj=hidServicesObj;
       hiddFaqObj=hidFaqObj;
       hiddLinksObj=hidLinksObj;
       hiddAboutObj=hidAboutObj;
       hiddContactObj=hidContactObj;
       
      //alert(hiddHomeObj);
    }
    function changeImages(argName, argImg) {
    //alert(argName);
    var el=null;
     
    
    if(argName=='home'&& hiddHomeObj!=null){
        //alert(document.getElementById(hiddHomeSelected).value);
        
            
           var lvl1obj = hiddHomeObj.replace('$', '_');
       el = document.getElementById(lvl1obj.replace('$', '_'));
        
    }
     if(argName=='services' && hiddServicesObj!= null){
       
       var lvl1obj = hiddServicesObj.replace('$', '_');
       el = document.getElementById(lvl1obj.replace('$', '_'));

    }
     if(argName=='faq'){
        
        
        var lvl1obj = hiddFaqObj.replace('$', '_');
       el = document.getElementById(lvl1obj.replace('$', '_'));
    }
     if(argName=='links'){
        
        
        var lvl1obj = hiddLinksObj.replace('$', '_');
       el = document.getElementById(lvl1obj.replace('$', '_'));
    }
     if(argName=='about'){
       
       
        var lvl1obj = hiddAboutObj.replace('$', '_');
       el = document.getElementById(lvl1obj.replace('$', '_'));
    }
     if(argName=='contact'){
        
        
        var lvl1obj = hiddContactObj.replace('$', '_');
       el = document.getElementById(lvl1obj.replace('$', '_'));
    }

    if(el!=null){
       el.src = argImg;
    }
    }

//gets the document properties in order to use them as there are many types of browers with different versions
function getDocID(tagLayer)
{
	var tagProp = "";//holds the proerties of tagLayer

	//gets the whichLayer Properties depending of the differnt bowers the user is using
	if (document.getElementById)//this is the way the standards work
		tagProp = document.getElementById(tagLayer);
	else if (document.all)//this is the way old msie versions work
		tagProp = document.all[tagLayer];
	else if (document.layers)//this is the way nn4 works
		tagProp = document.layers[tagLayer];
		
	return tagProp;
}//end of getDocID()

/* =========== Advanced Search ======== */
var MonthDays = new Array(31,28,31,30,31,30,31,31,30,31,30,31);

// change options data by user selected options
function loadDay(monthValue,objDay,yearValue){

	objDay.length = MonthDays[monthValue-1];
	for(var i=0; i<MonthDays[monthValue-1]; i++){
		objDay.options[i].value = objDay.options[i].text = i+1;
	}

	if(monthValue == 2 && yearValue/4 == Math.round(yearValue/4) 
	&& (yearValue/100 != Math.round(yearValue/100) || yearValue/400 == Math.round(yearValue/400))){
		objDay.length++;
		objDay.options[28].value = objDay.options[28].text = 29;
	}
}

function OnChangeIndexMonth(eltMonth, eltDay, eltYear)
{
    var eltY = document.getElementById(eltYear);
    loadDay(eltMonth.value,document.getElementById(eltDay), eltY.value);
}

function OnChangeIndexMonth(eltMonth, eltDay,eltYear)
{
    var eltY = document.getElementById(eltYear);
    loadDay(eltMonth.value,document.getElementById(eltDay), eltY.value);
}

function OnChangeIndexYear(eltYear, eltDay,eltMonth)
{
    var eltM = document.getElementById(eltMonth);
    loadDay(eltM.value,document.getElementById(eltDay), eltYear.value);
}

function OnChangeIndexYear(eltYear, eltDay,eltMonth)
{
    var eltM = document.getElementById(eltMonth);
    loadDay(eltM.value,document.getElementById(eltDay), eltYear.value);
}
