﻿// JavaScript Document
var isIE;
isIE = (navigator.appName == "Microsoft Internet Explorer" ); 
//alert(isIE);
function getElement( id ) 
{
	if(isIE) {
		return document.all[id];
	}
	else {
		return document.getElementById(id);
	}
}
function getElementName( name ) 
{
//	if(navigator.appName == "Microsoft Internet Explorer") {
if(isIE){
		return document.getElementsByName(name);
	//	return document.all[ name ];
	//}
	//else {
	}
}


//Creating and setting the instance of appropriate XMLHTTP Request object to a xmlHttp variable  
function getAjax()
{
	var XmlHttp;
	//Creating object of XMLHTTP in IE
	try
	{
		XmlHttp = new ActiveXObject("Msxml2.XMLHTTP");
	}
	catch(e)
	{
		try
		{
			XmlHttp = new ActiveXObject("Microsoft.XMLHTTP");
		} 
		catch(oc)
		{
			XmlHttp = null;
		}
	}
	//Creating object of XMLHTTP in Mozilla and Safari 
	if(!XmlHttp && typeof XMLHttpRequest != "undefined") 
	{
		XmlHttp = new XMLHttpRequest();
	}
	return XmlHttp;
}


function getUserList(Domain,Url)
{   var req;
    var Restr;
	req = getAjax();
	req.onreadystatechange = function(){
		if( req.readyState == 4 && req.status == 200 ) {
			Restr= req.responseText;}
		else{Restr=""}
	}
	req.open( 'GET', '/xml/CheckDomain.aspx?Url='+Url+'&Domain='+Domain, true );
	req.send( );
	return Restr;
}

function DomainCheck(Domain,Url,isRedrect)
{
 var reUrl;
 reUrl=getUserList(Domain,Url);
//  if (reUrl.length>0 & isRedrect)
  if (reUrl.length>8&reUrl.length<200)
  {
    window.location.href=reUrl;
  }
}


function menuFix() {
var sfEls = document.getElementById("CenterAddress").getElementsByTagName("li");
for (var i=0; i<sfEls.length; i++) {
sfEls[i].onmouseover=function() {
this.className+=(this.className.length>0? " ": "") + "sfhover";
}
sfEls[i].onMouseDown=function() {
this.className+=(this.className.length>0? " ": "") + "sfhover";
}
sfEls[i].onMouseUp=function() {
this.className+=(this.className.length>0? " ": "") + "sfhover";
}
sfEls[i].onmouseout=function() {
this.className=this.className.replace(new RegExp("( ?|^)sfhover\\b"), "");
}
}
}

