function open_smiles(file_path,page_id)
{
	document.getElementById('site_video').innerHTML="<div id='player'><embed src=\"/players/site_player.swf\" flashvars=\"&streamName="+file_path+"&page_id="+page_id+"\" quality=\"high\" scale=\"noscale\" width=\"600\" height=\"444\" name=\"FLVPlayer\" salign=\"LT\" type=\"application/x-shockwave-flash\" pluginspage=\"http://www.macromedia.com/go/getflashplayer\"  wmode=\"transparent\"></div>";
}
//play mp3
function play_mp3(file_path)
{
	if (document.getElementById('my_mp3'))
		document.getElementById('my_mp3').innerHTML="<embed src=\"/players/mp3.swf\" FlashVars=\"file_name="+file_path+"\" volume=70 hidden=true>";
	else 
	{
		var mp3=document.createElement("div");
		mp3.id="my_mp3";
		mp3.innerHTML="<embed src=\"/players/mp3.swf\" FlashVars=\"file_name="+file_path+"\" volume=70 hidden=true>";
		document.body.appendChild(mp3);
	}
	return false;
}
var the_intval_form;
function show_from()
{
	var the_intval_form=setInterval(
	function ()
	{
		document.getElementById('site_video').innerHTML="";
		document.getElementById('contact_form').style.display="block";
		the_intval_form=clearInterval(the_intval_form);
	},10);
}
var the_intval_handler;
function d_over(obj,sub_id)
{
	the_intval_handler=clearInterval(the_intval_handler);
	document.getElementById(sub_id).style.display="block";
	if (obj.style.backgroundColor!="#000000")
		obj.style.backgroundColor="#000000";
}
function d_out(obj,sub_id)
{
	document.getElementById(sub_id).style.display="none";	
	if (obj.style.backgroundColor!="#717171")
		obj.style.backgroundColor="#717171";
}
function clear()
{
	the_intval_handler=clearInterval(the_intval_handler);
}
var the_xml_point="";
//****************************************************************************************************
var cur_img=0;
//mode 0 next 1 prev
function show_testimonial(mode)
{
	if (mode)//prev
	{
		if (cur_img-1>=0)
		{
			cur_img-=1;
			document.getElementById("image_container").innerHTML="<img height=\"320px\" src=\""+the_xml_point.getElementsByTagName("my_img")[cur_img].childNodes[0].nodeValue+"\">";
		}
	}		
	else //next
	{
		if (cur_img+1<the_xml_point.getElementsByTagName("my_img").length)
		{
			cur_img+=1;
			document.getElementById("image_container").innerHTML="<img height=\"320px\" src=\""+the_xml_point.getElementsByTagName("my_img")[cur_img].childNodes[0].nodeValue+"\">";
		}
	}
}
function get_obj()
{
	the_xml_point=parseXML("testimonial.xml");	
	document.getElementById("image_container").innerHTML="<img height=\"320px\" src=\""+the_xml_point.getElementsByTagName("my_img")[0].childNodes[0].nodeValue+"\">";
}
function parseXML(file_name)
{
	var rssFeed="testimonial.xml";
	try
	{
		if (window.ActiveXObject)
		{
			var errorHappendHere = "Check Browser and security settings";
			xmlDoc = new ActiveXObject("Microsoft.XMLDOM");
			xmlDoc.async=false;
			xmlDoc.load(rssFeed);
		}
		else if(window.XMLHttpRequest)
		{
			
			var errorHappendHere = "Error handling XMLHttpRequest request";
			var d = new XMLHttpRequest();
			d.open("GET", rssFeed, false);
			d.send(null);
			xmlDoc=d.responseXML;
		} else {
			var errorHappendHere = "Error.";
			xmlDoc = document.implementation.createDocument("","",null);
			xmlDoc.async=false;
			xmlDoc.load(rssFeed);
		}
		return xmlDoc;
	}	
	catch(e)
	{
		alert(errorHappendHere);
		return false;
	}
}
function MM_CheckFlashVersion(reqVerStr,msg){
  with(navigator){
    var isIE  = (appVersion.indexOf("MSIE") != -1 && userAgent.indexOf("Opera") == -1);
    var isWin = (appVersion.toLowerCase().indexOf("win") != -1);
    if (!isIE || !isWin){  
      var flashVer = -1;
      if (plugins && plugins.length > 0){
        var desc = plugins["Shockwave Flash"] ? plugins["Shockwave Flash"].description : "";
        desc = plugins["Shockwave Flash 2.0"] ? plugins["Shockwave Flash 2.0"].description : desc;
        if (desc == "") flashVer = -1;
        else{
          var descArr = desc.split(" ");
          var tempArrMajor = descArr[2].split(".");
          var verMajor = tempArrMajor[0];
          var tempArrMinor = (descArr[3] != "") ? descArr[3].split("r") : descArr[4].split("r");
          var verMinor = (tempArrMinor[1] > 0) ? tempArrMinor[1] : 0;
          flashVer =  parseFloat(verMajor + "." + verMinor);
        }
      }
      // WebTV has Flash Player 4 or lower -- too low for video
      else if (userAgent.toLowerCase().indexOf("webtv") != -1) flashVer = 4.0;

      var verArr = reqVerStr.split(",");
      var reqVer = parseFloat(verArr[0] + "." + verArr[2]);
  
      if (flashVer < reqVer){
        if (confirm(msg))
          window.location = "http://www.macromedia.com/shockwave/download/download.cgi?P1_Prod_Version=ShockwaveFlash";
      }
    }
  } 
}