﻿	function emailPage(url) 
	{
	    var iframes = document.getElementsByTagName('iframe');
	    if (iframes != null && iframes != undefined)
	    {
		for (i = 0; i < iframes.length; ++i)
	        {
		   iframes[i].style.display = "none";
		}

     	    }


	    document.getElementById('overlay').style.display = "block";
	    document.getElementById('emailPage').style.display = "block";
	}
	function closeEmailPage(url) 
	{
	    document.getElementById('overlay').style.display = "none";
	    document.getElementById('emailPage').style.display = "none";

	    var iframes = document.getElementsByTagName('iframe');
	    if (iframes != null && iframes != undefined)
	    {
		for (i = 0; i < iframes.length; ++i)
	        {
		   iframes[i].style.display = "block";
		}

     	    }
	}
	function liveChat()
	{
        window.open("/images/livechatdummy.jpg","LiveChat","scrollbars=false,height=440,width=500");
	}
	function playVideo(videoUrl,height,width,version)
	{
		  // <![CDATA[
		   var so = new SWFObject(videoUrl, "preloader", height, width, version, "#FFFFFF");
		   so.useExpressInstall('/_swf/expressinstall.swf');
		   so.addParam("wmode", "transparent");
		   so.write("flashcontent");			  
		// ]]>
	}
    function show(divName)
	 {
		  if ($(document.getElementById(divName)).is(":hidden")) {
		  $(document.getElementById(divName)).slideDown("slow");
		  $(document.getElementById("header_" + divName)).addClass("selected");
		  } else {
		  $(document.getElementById(divName)).slideUp("slow");
		  $(document.getElementById("header_" + divName)).removeClass("selected");
		  }
	}
    function addLoadEvent(func) {   
       var oldonload = window.onload;   
       if (typeof window.onload != 'function') {   
         window.onload = func;   
       } else {   
            window.onload = function() {   
           if (oldonload) {   
             oldonload();   
           }   
           func();   
         }  
      } 
   }   
   function getChannel()
   {
            var locName = new String(window.location).replace("http://","");
            locName = locName.substring(locName.indexOf("/")+1);
            locName = locName.substring(0,locName.indexOf("/"));
            
            var indexOfMatch = 0;
            while (indexOfMatch != -1){
              locName = locName.replace("-"," ")
              indexOfMatch = locName.indexOf("-");
            }
            /*if (locName.indexOf(".aspx") == -1)
            {
              locName = locName.substring(0,locName.lastIndexOf("/"));
            } else {
              locName = locName.substring(0,locName.lastIndexOf("."));
            }
            var indexOfMatch = 0;
            var indexOfMatch2 = 0;
            while (indexOfMatch != -1){
              locName = locName.replace("-"," ")
              indexOfMatch = locName.indexOf("-");
            }
            
            while (indexOfMatch2 != -1){
              locName = locName.replace("/"," > ")
              indexOfMatch2 = locName.indexOf("/");
            }
            */
            return locName;
   }