﻿

function pop_CustomWindow(pURL, pWindowName, pProperties)
{
  var confirmWin = null;
  confirmWin = window.open(pURL,pWindowName,pProperties);
}

function popup_VideoGuide(pSection)
{
  var confirmWin = null;
  confirmWin = window.open('/videopopup.aspx?id=' + pSection,'VideoWindow','width=640,height=510,status=no');
  //psection = videocategoryID in illuminatitrader DB
}
        
function pop_StrategyAnalyzer(pStrategyAnalyzerURL)
{
    if (getOs() == "MSIE")
  { 
        var confirmWin = null;
        confirmWin = window.open(pStrategyAnalyzerURL,'AnalyzerWindow','width=655,height=750,location=no, menubar=no,resizable=yes, scrollbars=yes, status=no, titlebar=no, toolbar=no');
    }
   else
   { 
    window.modal(pStrategyAnalyzerURL,'width=655,height=750,toolbars=0,resizable=0');return false;
   } 
}

function pop_ImpliedVolChart(pImpliedVolURL)
{
  var confirmWin = null;
  confirmWin = window.open(pImpliedVolURL,'ImpliedVolatility',
						   'width=650,height=542,location=no, menubar=no,resizable=no, scrollbars=no, status=no, titlebar=no, toolbar=no');
}

function pop_Testimonials()
{
  var confirmWin = null;
  confirmWin = window.open('/popupTestimonials.html', 'width=500,height=600,location=no, menubar=no,resizable=no, scrollbars=yes, status=no, titlebar=no, toolbar=no');
}

function HiddenDisplay(spanObj, obj)
{
    if (obj.style.display == "none")
    {
        obj.style.display = "block";
        spanObj.innerHTML = "O";
    }
    else
    {
        obj.style.display = "none";
        spanObj.innerHTML = "A";
    }
} 

function HiddenDisplayMore(spanObj, obj)
{
    if (obj.style.display == "none")
    {
        obj.style.display = "block";
        spanObj.innerHTML = "less...";
    }
    else
    {
        obj.style.display = "none";
        spanObj.innerHTML = "more...";
    }
} 

// 05/05/2008	Neil Chen
// Check client's browser type
function getOs() 
{ 
   var OsObject = ""; 
   
   if(navigator.userAgent.indexOf("MSIE")>0) 
   { 
        return "MSIE"; 
   } 
   
   if(isFirefox=navigator.userAgent.indexOf("Firefox")>0)
   { 
        return "Firefox"; 
   } 
   
   if(isSafari=navigator.userAgent.indexOf("Safari")>0) 
   { 
        return "Safari"; 
   }  
   
   if(isCamino=navigator.userAgent.indexOf("Camino")>0)
   { 
        return "Camino"; 
   } 
   
   if(isMozilla=navigator.userAgent.indexOf("Gecko/")>0)
   { 
        return "Gecko"; 
   } 
}

//04/06/2008    Chen Weibo      Show flash
function insertFlash(elm, url, w, h) 
{
    if (!document.getElementById(elm)) return;
    var str = '';
    str += '<object width="'+ w +'" height="'+ h +'" classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=7,0,0,0">';
    str += '<param name="movie" value="'+ url +'">';
    str += '<param name="wmode" value="transparent">';
    str += '<param name="quality" value="autohigh">';
    str += '<embed width="'+ w +'" height="'+ h +'" src="'+ url +'" quality="autohigh" wmode="transparent" type="application/x-shockwave-flash" plugspace="http://www.macromedia.com/shockwave/download/index.cgi?P1_Prod_Version=ShockwaveFlash"></embed>';
    str += '</object>';
    document.getElementById(elm).innerHTML = str;
}

/******************************************************************************/
//
// NOTE TO DEVELOPERS:
// The following code should be integrated with your web page in order to open
// the presentation in a new window.  To launch the presentation immediately, 
// simply copy the code below into your web page.  To launch the presentation
// when a button or link is clicked, call LaunchPresentation when the onClick
// event is triggered.
//
// 
// LaunchPresentation(bChromeless, bResize)
//
// Parameters:
//	bChromeless - Opens a new window without the toolbar, addressbar, statusbar,
//		      menubar, and scrollbars
//	
//	bResize - Determines whether or not the new window can be resized
//
/******************************************************************************/

function LaunchPresentation(pUrl, bChromeless, bResize)
{
	var nWidth = screen.availWidth;
	var nHeight = screen.availHeight;

	// Get the width
	if (nWidth > 820)
	{
		nWidth = 980;
		nHeight = 640;
	}

	// Build the options string
	var strOptions = "width=" + nWidth +",height=" + nHeight;
	if (bResize)
	{
		strOptions += ",resizable=yes"
	}

	if (bChromeless)
	{
		strOptions += ", status=0, toolbar=0, location=0, menubar=0, scrollbars=0";
	}
	else
	{
		strOptions += ", status=1, toolbar=1, location=1, menubar=1, scrollbars=1";
	}

	// Launch the URL
	window.open(pUrl, "_blank", strOptions);

}

function windowOpen(blogID)
{
   if (getOs() == "MSIE")
  { 
        window.showModalDialog("Illuminati-Trader-Stock-Options-Trading-Videos-Player.aspx?BlogID=" + blogID,"win","dialogHeight:500px;dialogWidth:450px;center:yes;Help:No;resizable:No;status:no;");   
   } 
  else
  { 
        window.open("Illuminati-Trader-Stock-Options-Trading-Videos-Player.aspx?BlogID=" + blogID, "_blank", "modal=yes,left=200,top=150,height=500,width=450,resizable=no,status=no,scrollBars=yes");
  } 
}

// 05/05/2008	Neil Chen
// Trims left and right space of string object.
String.prototype.Trim = function() 
{ 
    return this.replace(/(^\s*)|(\s*$)/g, ""); 
} 

// 05/05/2008	Neil Chen
// Trims left space of string object.
String.prototype.LTrim = function() 
{ 
    return this.replace(/(^\s*)/g, ""); 
} 

// 05/05/2008	Neil Chen
// Trims right space of string object.
String.prototype.RTrim = function() 
{ 
    return this.replace(/(\s*$)/g, ""); 
}

function RegisterClick(obj)
{
    var o = document.getElementById(obj);    
    
    if(document.all && typeof(document.all) == "object")   
    {
        o.click();
    }
    else
    {
        document.getElementById("logon").value = "login";
        
        __doPostBack(obj,'');
    }
}