// JavaScript Document
<!--

var ucookie;
var ncookie;

ucookie=getCookie("wbxPortal_usertype"); 
//ucookie="Enterprise" ;

ncookie=getCookie("wbxPortal_firstname");

var qs = new Querystring();
var wsb= qs.get("wsb");

var ft = getCookie("TS");
if (!ft) 
ft = 0; 
else 
ft = 1;

//alert(wsb);
//alert(document.cookie);

/*
if (!wsb)
{
     var href1 = qs.get("hbxref");
        if (!href1)
       {
	href1 = escape(document.referrer);			
	if (!href1) href1 = "";                                                		
        }
        else href1=escape(href1);
		 
       var a1output = "<script type='text/javascript' src='http://www.webex.com/inc/shp.php?ref=" + href1 + "'></script>";
       document.write(a1output);
   
     function checkoutput() {alert(a1output);};
}
else
{
	var output = "<script type='text/javascript' src='http://www.webex.com/inc/shp.php?wsb=" + wsb + "'></script>";
               document.write(output);	
}

*/

var MM_contentVersion = 5;
var plugin = (navigator.mimeTypes && navigator.mimeTypes["application/x-shockwave-flash"]) ? navigator.mimeTypes["application/x-shockwave-flash"].enabledPlugin : 0;
if ( plugin ) {
		var words = navigator.plugins["Shockwave Flash"].description.split(" ");
	    for (var i = 0; i < words.length; ++i)
	    {
		if (isNaN(parseInt(words[i])))
		continue;
		var MM_PluginVersion = words[i]; 
	    }
	var MM_FlashCanPlay = MM_PluginVersion >= MM_contentVersion;
}
else if (navigator.userAgent && navigator.userAgent.indexOf("MSIE")>=0 
   && (navigator.appVersion.indexOf("Win") != -1)) {
	document.write('<script language=vbscript \> \n'); //FS hide this from IE4.5 Mac by splitting the tag
	document.write('on error resume next \n');
	document.write('MM_FlashCanPlay = ( IsObject(CreateObject("ShockwaveFlash.ShockwaveFlash." & MM_contentVersion)))\n');
	document.write('</script> \n');
}

//-->


function flash_main()
{
 
  if ( MM_FlashCanPlay ) {

var r_flash = new Array();
var ld;
//list the flash
if (fname == "main_ctas_on")
{ 
  ld ="on"; 
}
else
{  ld="off"; }

//ld="on";

r_flash[0] = "main";
r_flash[1]="main_long";

//Add cookie checking for A/B testing
//alert(document.cookie);

    // create an instance of the Date object
//    var now = new Date();
//    var exp = new Date(now.getFullYear(), now.getMonth()+1, now.getDate(), 00, 00, 00);

 //setCookie("hfck", 1, exp, "/");

//  var visits = getCookie("hfck");

  // if the cookie wasn't found, this is your first visit
/*
if (!visits) 
  {
     var rand1 = Math.round(Math.random()*(r_flash.length-1));
     setCookie("hfck", rand1, exp, "/");
  }
  else
  {
     var rand1 = visits; 	
   }
*/

rand1 = 0; 
rfname = r_flash[rand1];

if (rand1 == 0)
{
   lw = 800;
   lh = 191;
 document.write("<a href=\"javascript:_hbLink('LiveDemo','general', '550, 35, 250, 51')\"></a>");
 document.write("<a href=\"javascript:_hbLink('FreeTrial', 'general', '550, 88, 250, 51')\"></a>");
 document.write("<a href=\"javascript:_hbLink('Buy', 'general', '550, 140, 250, 51')\"></a>");
}
else
{
   lw = 782;
   lh = 189;
}


var lf ; 
/*
if (faim=="main_aim_on")
   lf = "aimon";
else 
   lf = "aimoff";
*/

var ran1 = Math.round(Math.random());
if (ran1==0)
   lf = 0;
else 
   lf = 1;


 rfname="main";  


/*  lw = 250;  short button for left image file
   rfname="main_button"; 
    + '<param name="movie" value="/fileadmin/images/home/' +rfname +  '.swf?ld=' + ld + '&ft=' + ft + '&dcontent='+ lf + '" /><param name="quality" value="high" /><param name="wmode" value="transparent" />'

*/
/*    + '<param name="movie" value="/fileadmin/images/home/' +rfname +  '.swf?ld=' + ld + '&ft=' + ft + '&dcontent='+ lf + '" /><param name="quality" value="high" /><param name="wmode" value="transparent" />'
*/

 document.write("<a href=\"javascript:_hbLink('LearnMore', 'general' , '286, 130, 92, 24')\"></a>");

    var oeTags = '<object classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000"'
    + 'width=' + lw + ' height=' + lh
    + ' codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab">'
    + '<param name="movie" value="http://www.webex.com/media/hpflash/' +rfname +  '.swf?ld=' + ld + '&ft=' + ft + '&dcontent='+ lf + '" /><param name="quality" value="high" /><param name="wmode" value="transparent" />'
    + '<embed src="http://www.webex.com/media/hpflash/' + rfname +  '.swf?ld=' + ld + '&ft=' + ft + '&dcontent=' + lf + '" quality="high" wmode="transparent" bgcolor="#ffffff" '
    + 'width=' + lw +  ' height=' + lh + ' name="main" align="right"'
    + 'play="true"'
    + 'loop="false"'
    + 'quality="high"'
    + 'allowScriptAccess="sameDomain"'
    + 'type="application/x-shockwave-flash"'
    + 'pluginspage="http://www.macromedia.com/go/getflashplayer">'
    + '</embed>'
    + '</object>';

 if (rand1 == 1)
 { 
    document.write('<div style="position:absolute; left:18px; top:2px;">');
  }

    document.write(oeTags);

if (rand1 == 1)
{ 
  document.write('</div>'); 
}

} 
else{

var rand1 = 0;
if (rand1 == 1)
{
document.write('<img src="/fileadmin/images/home/main_long.jpg" border=0 usemap="#longmap">');
document.write('<map name="longmap">');
document.write('<area shape="rect" coords="534,142,700,178"  href="http://www.webex.com/go/choosetrial">');
document.write('</map>');
}
else
{

document.write('<map name="smap">');
document.write('<area shape="rect" coords="371,130,533,159"  href="http://www.webex.com/go/choosetrial">');
document.write('<area shape="rect" coords="548,23,797,78"  href="http://www.webex.com/go/demo">');
document.write('<area shape="rect" coords="553,83,797,131"  href="http://www.webex.com/go/choosetrial">');
document.write('<area shape="rect" coords="553,138,797,189"  href="http://www.webex.com/go/buy">');
document.write('</map>');
 
 if (fname == "main_ctas_on")
 {
 document.write('<img src="/fileadmin/images/home/main_short_on.jpg" border=0 usemap="#smap">');
  }
  else
  {
 document.write('<img src="/fileadmin/images/home/main_short_off.jpg" border=0 usemap="#smap">');
  }
}
}
}


function setCookie(name, value, expires, path, domain, secure) {
//domain = 'www.webex.com';
  path = "/";
  var curCookie = name + "=" + escape(value) +
      ((expires) ? "; expires=" + expires.toGMTString() : "") +
      ((path) ? "; path=" + path : "") +
      ((domain) ? "; domain=" + domain : "") +
      ((secure) ? "; secure" : "");

    document.cookie = curCookie;
}

function flash_bottom()
{

if ( MM_FlashCanPlay ) {

    var obTags = '<object classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" width="234" height="59"  codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab">'
+ '<param name="movie" value="/fileadmin/images/home/hp_awards.swf" \/>'
+ '<param name="quality" value="high" \/>'
+ '<param name="wmode" value="transparent" \/>'
+ '<param name="bgcolor" value="#ffffff" \/>'

    + '<embed src="/fileadmin/images/home/hp_awards.swf" quality="high" wmode="transparent" bgcolor="#ffffff" width="234" height="59" align="middle">'
    + '<\/embed>'
    + '<\/object>';
    document.write(obTags);

} 
else{
document.write('<a href="http://www.infoworld.com/article/06/01/02/73433_01FEtoyawards_2.html"><IMG SRC="/fileadmin/images/home/award_static.gif" border=0></a>');
}

}


function flash_bar()
{

if (fname == "main_ctas_on")
 { bf = "bottom_on";}
else
 { bf = "bottom_off";}


if ( MM_FlashCanPlay ) {

document.write("<a href=\"javascript:_hbLink('LiveDemo','general_bottom', '0, 0, 250, 35')\"></a>");
document.write("<a href=\"javascript:_hbLink('FreeTrial','general_bottom', '266, 0, 250, 35')\"></a>");
document.write("<a href=\"javascript:_hbLink('Buy','general_bottom', '532, 0, 250, 35')\"></a>");

    var bTags = '<object classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000"'
    + 'width=782 height=45'
    + ' codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab">'
    + '<param name="movie" value="/fileadmin/images/home/' +bf +  '.swf" /><param name="quality" value="high" /><param name="wmode" value="transparent" />'
    + '<embed src="/fileadmin/images/home/' + bf +  '.swf" quality="high" wmode="transparent" bgcolor="#ffffff" '
    + 'width="782"  height="45"' + ' name="main" align="middle"'
    + 'play="true"'
    + 'loop="false"'
    + 'quality="high"'
    + 'allowScriptAccess="sameDomain"'
    + 'type="application/x-shockwave-flash"'
    + 'pluginspage="http://www.macromedia.com/go/getflashplayer">'
    + '<\/embed>'
    + '<\/object>';

    document.write('<div style="positon:relative;padding-top:2px;z-index:6;">');
    document.write(bTags);
    document.write('</div>');
}
else{

document.write('<map name="mapbottom">');
document.write('<area shape="rect" coords="5,3,251,38" href="http://www.webex.com/go/demo">');
document.write('<area shape="rect" coords="270,3,515,38" href="http://www.webex.com/go/choosetrial">');
document.write('<area shape="rect" coords="535,4,780,34" href="http://www.webex.com/go/buy">');
document.write('</map>');

 if (fname=="main_ctas_on")
{
        document.write('<img src="/fileadmin/images/home/bottom_on.gif" border=0 usemap="#mapbottom">');
 }
else
{
        document.write('<IMG SRC="/fileadmin/images/home/bottom_off.gif" border=0 usemap="mapbottom">');
}

}

}

function Querystring()
{
// get the query string, ignore the ? at the front.
	var querystring=location.search.substring(1,location.search.length);

// parse out name/value pairs separated via &
	var args = querystring.split('&');

// split out each name = value pair
	for (var i=0;i<args.length;i++)
	{
		var pair = args[i].split('=');

		// Fix broken unescaping
		temp = unescape(pair[0]).split('+');
		var name = temp.join(' ');

		temp = unescape(pair[1]).split('+');
		value = temp.join(' ');

		this[name]=value;
	}

	this.get=Querystring_get;

}



function Querystring_get(strKey,strDefault)
{
	var value=this[strKey];
	if (value==null)
	{
		value=strDefault;
	}

	return value;
}

function getCookie(name) {
  var dc = document.cookie;
  var prefix = name + "=";
  var begin = dc.indexOf("; " + prefix);
  if (begin == -1) {
    begin = dc.indexOf(prefix);
    if (begin != 0) return null;
  } else
    begin += 2;
  var end = document.cookie.indexOf(";", begin);
  if (end == -1)
    end = dc.length;
  return unescape(dc.substring(begin + prefix.length, end));
}


function PopWindow(URL, target, popflag) {
	var param = target.split("x");
	if (popflag != 1)
	{
                  window.open(URL, "", 'width='+param[0]+',height='+ param[1]+',toolbar = 0, titlebar = 0');
	} else
	{
	  window.open(URL, "", 'width=' + param[0]+',height='+param[1]+',toolbar=1, titlebar=1, scrollbars=1, menubar=1,location=1, resizable=1');
	}
}

function logoff() {
if (!myemail) var myemail="";	
window.open("http://www.webex.com/go/portallogoff?email="+myemail);
document.location ="https://support.webex.com/SelfServiceWeb/logout.jsp";
}
