// JavaScript Document

var xmlHttp 
function showHint(str)
{
	var obj;
	var objBG;
	var imageName;
	var imageNameBG;
	
	imageName = "HairExtension_RE.jpg";
	imageNameBG = "HairExtension_BG.jpg";
	
	
	document.getElementById("ShowData").innerHTML='<span class="HighlightWord"> .::. Loading.... </span>' ;
	
	switch(str)
	{
		case "BridalMenu" :
		case "BSPhotoG":
		case "BridalMenu" :
		case "BridalServices" :
		case "BSTestimonial" :
			imageName = "BridalServices_RE.jpg";
			imageNameBG = "BridalServices_BG.jpg";
			break;

			
		case "Home" :
		case "ContactUs" :
		case "AboutUs" :
		case "Business" :
		case "HETestimonial" :
		case "Links" :
		case "LinkExchange" :
		case "Directions_Astoria":
		case "Directions_Whitestone":
			alert(str);
			imageName = "Home_RE.jpg";
			imageNameBG = "Home_BG.jpg";
			break;

		case "SalonServices" :
			imageName = "SalonServices_RE.jpg";
			imageNameBG = "SalonServices_BG.jpg";
			break;

		case "PrivateServices" :
			imageName = "PrivateServices_RE.jpg";
			imageNameBG = "PrivateServices_BG.jpg";
			break;


		case "SkinCare" :
		case "SkinTreatment" :
		case "SCEndermologie" :
		case "SCMicrodera" :
		case "SCAcne" :
			imageName = "SkinCare_RE.jpg";
			imageNameBG = "SkinCare_BG.jpg";
			break;
		
		
		case "GreatLength" :
		case "ColdFusion":
		case "GLPhotoG" :
		case "GLBAPhoto" :
		case "GL_Video" :
		case "GLPrices" :
		
		case "HairLoc" :
		case "HLPhotoG" :
		case "HLBAPhoto" :
		case "HL_Video" :
		case "HLPrices" :

		
		case "Fussion" :
		case "FSPhotoG" :
		case "FSBAPhoto" :
		case "FS_Video" :
		case "FSPrices" :
		
		
		case "Removable" :
		case "RCPhotoG" :
		case "RCBAPhoto" :
		case "RC_Video" :
		case "RCPrices" :
		
		case 'RemyLinks':
		case 'RLPhotoG':
		case 'RLBAPhoto':
		case 'RL_Video':

		case "HElinks" :
		case "HairExtension":
		case "Short2Long" :
		case "SLPhotoG" :
		case "SLBAPhoto" :
		case "SL_Video" :
		case "SoCaps" :
		case "OSPhotoG" :
		case "OSBAPhoto" :
		case "OS_Video" :
		case "Microchet" :
		case "MCBAPhoto" :
		case "MC_Video" :
		case "NewSection" :
		case "HairWeaving" :
		case "InvisibleHair" :
		case "Ultratress":
		case "RemyLinks":
		case "LaceFront":
		case "LFPhotoG":
		case "LFBAPhoto":
		case "LSPhotoG":
		case "LSBAPhoto":
		case "LF_Video":
		
		case "INPhotoG":
		case "HWPhotoG":
		case "Non-SurgicalHairReplacement":
		case "InvisibleStrand":
		case "Integration":
		case "CustomHairsthetics":
		case "InvisibleHair":
		case "MoreTechniques":
		case "BrazilianKeratin":
		case "LuxHair":
		
			imageName = "HairExtension_RE.jpg";
			imageNameBG = "HairExtension_BG.jpg";
			break;

		case "EyeLashes" :
		case "XtremeLashes" :
			imageName = "EyeLashes_RE.jpg";
			imageNameBG = "EyeLashes_BG.jpg";
			break;
			
			
		default :
			imageName = "HairExtension_RE.jpg";
			imageNameBG = "HairExtension_BG.jpg";
			break;
		
	}
	

	obj = document.getElementById("ShowImage");
	objBG = document.getElementById("ShowImageBG");
	
	obj.style.backgroundImage='url(images/' + imageName + ')';
	objBG.style.backgroundImage='url(images/' + imageNameBG + ')';
	
	

	//Call image fade effect function
	//fnToggle();	
	//fnToggleBG();	
	

	if (str.length==0)
	{ 

		document.getElementById("ShowData").innerHTML="" 
		return 
	}
	xmlHttp=GetXmlHttpObject() 
	
	if (xmlHttp==null)
	{
		alert ("Browser does not support HTTP Request") 
		return 
	} 
	var url="ReadData.php" 
	url=url+"?data="+str 
	url=url+"&sid="+Math.random() 
	xmlHttp.onreadystatechange=stateChanged 
	xmlHttp.open("GET",url,true)
	xmlHttp.send(null)
} 

function stateChanged() 
{ 
	if (xmlHttp.readyState==4 || xmlHttp.readyState=="complete")
	{ 
		document.getElementById("ShowData").innerHTML=xmlHttp.responseText  
	} 
} 

function GetXmlHttpObject()
{ 
	var objXMLHttp=null 
		
	if (window.XMLHttpRequest)
	{
		objXMLHttp=new XMLHttpRequest() 
	}
	else if (window.ActiveXObject)
	{
			
		objXMLHttp=new ActiveXObject("Microsoft.XMLHTTP") 
	}
	return objXMLHttp 
} 


function changeclass(id, newClass) 
{
	var identity
	identity=document.getElementById(id);
	identity.className=newClass;
}


function changeIdclass(id, newClass) 
{
	id.className=newClass;
}







/*
//--Image fade effect is applied vai this function
var bTranState = 0;
function fnToggle() 
{

	var oDIV1;
	var oDIV2;
	var oTransContainer;
	oTransContainer = document.getElementById("ShowImage") ;
	oDIV1 = document.getElementById("DIV1") ;
	oDIV2 = document.getElementById("DIV2") ;


    oTransContainer.filters[0].Apply();
    if (bTranState=='0') 
	{ 
		bTranState = 1;
        oDIV2.style.visibility="visible"; 
		oDIV1.style.visibility="hidden";
	}
    else
	{  
		bTranState = 0;
        oDIV2.style.visibility="hidden"; 
		oDIV1.style.visibility="visible";
	}
    oTransContainer.filters[0].Play();
}

//--Image fade effect is applied vai this function
var bTranState1 = 0;
function fnToggleBG() 
{

	var oDIV3;
	var oDIV4;
	var oTransContainer;
	oTransContainer = document.getElementById("ShowImageBG") ;
	oDIV3 = document.getElementById("DIV3") ;
	oDIV4 = document.getElementById("DIV4") ;


    oTransContainer.filters[0].Apply();
    if (bTranState1=='0')
	{ 
		bTranState1 = 1;
        oDIV4.style.visibility="visible"; 
		oDIV3.style.visibility="hidden";
	}
    else
	{  
		bTranState1 = 0;
        oDIV4.style.visibility="hidden"; 
		oDIV3.style.visibility="visible";
	}
    oTransContainer.filters[0].Play();
}

*/

/*---------------[  Windows Media player related javascript ] --------------------------*/

function setMovieNum(Mnum,loc){

	Mobj = document.getElementById('Mnum');
	Mobj.value = Mnum;
	window.location = '_self';

}

function setMovie(MNum,TopicID){
	if(navigator.appName == "Microsoft Internet Explorer")
	{
		
	  obj = document.getElementById('MediaPlayer1');	
	  
	  obj.FileName = "video/" + TopicID.substring(1,3) + "_Video" + MNum + ".wmv" ;
	  obj.Play();
	}
	else {
	  var myurl;
	  myurl = TopicID.substring(1,3);
	  window.location.href="index.php?data=Video&B=NOIE&TopicID=" + myurl + "&Mnum=" + MNum;
	  }
}



//Detect ActiveX Architecture on Both IE and on Gecko
//Defer to plugin architecture for other browsers

function detectWMP()
{
	var wmpInfo = {
		installed: false,
		scriptable: false,
		type: null,
		versionInfo: null
	};
	var wmp64 = "MediaPlayer.MediaPlayer.1";
	var wmp7 = "WMPlayer.OCX.7";
	if((window.ActiveXObject && navigator.userAgent.indexOf('Windows') != -1) || window.GeckoActiveXObject)
	{
		wmpInfo.type = "ActiveX";
		var player = createActiveXObject(wmp7);
		if(player)
		{
			wmpInfo.installed = true;
			wmpInfo.scriptable = true;
			wmpInfo.versionInfo = player.versionInfo;
			return wmpInfo;
		}
		else
		{
			player = createActiveXObject(wmp64);
			if(player)
			{
				wmpInfo.installed = true;
				wmpInfo.scriptable = true;
				wmpInfo.versionInfo = "6.4";
				return wmpInfo;
			}
			else
			{
				wmpInfo.versionInfo = "none";
				return wmpInfo;
			}
		}
	}
	else if(navigator.mimeTypes)
	{
		wmpInfo.type = "NetscapePlugin";
		var player = navigator.mimeTypes['application/x-mplayer2'].enabledPlugin;
		if(player)
		{	
			
			wmpInfo.installed = true;
			//wmpInfo.scriptable = false;
			wmpInfo.versionInfo = "PluginVersion";
			return wmpInfo;
		}
		return wmpInfo;
	}
	
	
}
function createActiveXObject(id)
{
  var error;
  var control = null;

  try
  {
    if (window.ActiveXObject)
    {
      control = new ActiveXObject(id);
    }
    else if (window.GeckoActiveXObject)
    {
      control = new GeckoActiveXObject(id);
    }
  }
  catch (error)
  {
    ;
  }
  return control;
}
	

function printResults()
{
	alert ("Ia am in");
	var detectionResults = detectWMP();
	document.write("Browser architecture supports: " + detectionResults.type + "\n");
	document.write("Windows Media Player Installed: " + detectionResults.installed + "\n");
	if(detectionResults.installed)
	{
		document.write("Windows Media Scriptable: " + detectionResults.scriptable + "\n");
		document.write("Windows Media Version: " + detectionResults.versionInfo + "\n");
	}
	
}


