function initPage(){
	//initInputs();
	initMap();
}

function initInputs(){
	var inputs = document.getElementsByTagName("input");
	for (var i = 0; i < inputs.length; i++ )
	{
		if(inputs[i].type == "text" )
		{
			inputs[i].valueHtml = inputs[i].value;
			inputs[i].onfocus = function() {
			    if (this.valueHtml == this.value) {
			        //this.value = ""; commented by prajakta to avoid lost of data on textbox click event . 11 Jan 2011
			    }
			}
			inputs[i].onblur = function ()
			{
				this.value != ""? this.value = this.value: this.value = this.valueHtml;
			}
		}
	}
}

//Image Map
var state_list;
function initMap() {
	var _map = document.getElementById("map");
	if (_map) {
		createMap(_map);
	}
}
function createMap(_map) {
	state_list = document.getElementById("map-hover").getElementsByTagName("li");
	var _areas = _map.getElementsByTagName("area");
		for (i = 0; i < _areas.length; i ++) {
			if (_areas[i].alt) {
				var _node = document.getElementById(_areas[i].alt);
				if (_node) {
					_areas[i]._node = _node;
					_areas[i].onmouseover = function() {
						if (this._node.className.indexOf("activestate") == -1)
						{
							this._node.className += " activestate";

						}
					}
					_areas[i].onmouseout = function() {
						this._node.className = this._node.className.replace("activestate", "");
					}
				}
			}
		}
}

if (window.addEventListener){	window.addEventListener("load", initPage, false);}
else if (window.attachEvent) { window.attachEvent("onload", initPage); }

$(document).ready(function() {
    var popupOpen = 0;
    $(".sv_arrow").click(function() {
        $(".popup-search").slideToggle(400);
    });
    $(".btn-close").click(function() { $(".popup-search").slideUp(400); });


});

