var LoginWindow;function checkLoginEnter(myfield,e)
{var keycode;if(window.event)keycode=window.event.keyCode;else if(e)keycode=e.which;else return true;if(keycode==13)
{handleLoginSubmit();return false;}
else
return true;}
function checkLoginEnterSingleton(myfield,e)
{var keycode;if(window.event)keycode=window.event.keyCode;else if(e)keycode=e.which;else return true;if(keycode==13)
{handleLoginSubmitSingleton();return false;}
else
return true;}
function handleLoginSubmitSingleton()
{var i;if((document.forms['popuplogin'].email.value.length>2)&&(document.forms['popuplogin'].password.value.length>2))
{if(document.forms['popuplogin'].autologin.checked==true)
{try
{setCookie('c2autologin',document.forms['popuplogin'].autologin.checked,90);setCookie('c2email',document.forms['popuplogin'].email.value,90);var xor_key=7;var to_enc=document.forms['popuplogin'].password.value;var enc='';for(i=0;i<to_enc.length;++i)
{enc+=String.fromCharCode(xor_key^to_enc.charCodeAt(i));}
setCookie('c2pw',enc,90);}
catch(err)
{}}
popupshow(false);localSubmit(document.getElementById('popuplogin'));}
return false;}
function handleLoginSubmit()
{var i;if(navigator.userAgent.indexOf("BlackBerry")!=-1)
{alert("Welcome, BlackBerry user. We are working on improving BlackBerry support. Let us know how we are doing.");document.forms['popuplogin'].submit();return;}
if((document.forms['popuplogin'].email.value.length>2)&&(document.forms['popuplogin'].password.value.length>2))
{if(document.forms['popuplogin'].autologin.checked==true)
{setCookie('c2autologin',document.forms['popuplogin'].autologin.checked,90);setCookie('c2email',document.forms['popuplogin'].email.value,90);var xor_key=7;var to_enc=document.forms['popuplogin'].password.value;var enc='';for(i=0;i<to_enc.length;++i)
{enc+=String.fromCharCode(xor_key^to_enc.charCodeAt(i));}
setCookie('c2pw',enc,90);}
popupshow(false);document.forms['popuplogin'].submit();}
return false;}
function loadLoginCookies()
{var i;var autologin=getCookie('c2autologin');if(autologin!=null&&autologin!=""&&autologin!==undefined)
{try
{document.forms['popuplogin'].autologin.checked=autologin;}
catch(e){}
if(autologin=='true')
{var email=getCookie('c2email');if(email!=null&&email!="")
{try{document.forms['popuplogin'].email.value=email;}
catch(e){}}
var pw=getCookie('c2pw');if(pw!=null&&pw!="")
{var xor_key=7;var res=''
for(i=0;i<pw.length;i++)
{res+=String.fromCharCode(xor_key^pw.charCodeAt(i));}
try{document.forms['popuplogin'].password.value=res;}
catch(e){}}}}}
function loginpopupshowInside(sw,pageElName,setLoginForCC)
{return startLogin(setLoginForCC,1);}
function startLogin(setLoginForCC,site)
{if((navigator.userAgent.match(/Android/i))||(navigator.userAgent.match(/iPhone/i))||(navigator.userAgent.match(/iPad/i))){window.location=SITE_BASE_SSL+"/login";return;}
var main_text='<form action="'+SITE_BASE_SSL+'/cgi-perl/login.mpl" method="POST" name="popuplogin" id="popuplogin">';if(setLoginForCC)
{main_text+='<input type="hidden" name="setLoginForCC" value="1" />';}
main_text+='<br/><center><table class="loginTable"><tr><td style="font-size: 120%;">Email&nbsp; </td><td><input style="background-color:#fff;border:invert;" type="text" onkeypress="return checkLoginEnter(this,event);" tabindex="1" size="30" name="email" id="email"></td></tr><tr><td style="font-size: 120%;">Password&nbsp; </td><td><input type="password" style="background-color:#fff;border:invert;" onkeypress="return checkLoginEnter(this,event);" tabindex="2" size="30" name="password"></td></tr><tr><td align="center" colspan="2"><input type="checkbox" tabindex="4" value="1" name="autologin"> Keep password stored on this computer?</td></tr></table>';if(site)
{main_text+='<a href="#" onclick="pendURL.push(\'/cgi-perl/utility/ajax_util.mpl?rm=showC2Register\');return false;" style="margin-right:120px">Need an account? (it\'s free)</a>';}
main_text+='<a href="/static/forgot.htm?nologinreturn=1">Forget your password?</a></form>';if(LoginWindow)
{LoginWindow.update('');}
var sitename;if(site==1)
{sitename=SITE_NAME;}
else if(site==2)
{sitename="Cassandra Project";}
else
{sitename="<span class='y'>You</span>tualFunds.com";}
if(sitename=='Vision Financial Markets')
{sitename='Collective2';}
LoginWindow=new Q.Confirm("<span style='float:left;font-size:16px;padding-top:8px;'>"+sitename+" Log In</span><span style='float:right;padding-top:8px;font-size:9px;font-weight:normal;'>Log In with Facebook instead: &nbsp;<a href='/cgi-perl/user/facebook.mpl'><img style='vertical-align:-6px' src='/images/fb_connect.gif'/></a></span>",main_text,{style:'info',draggable:true,width:550,onConfirm:function(){handleLoginSubmit();}});setTimeout("loadLoginCookies();$('email').focus();",500);}
function loginpopupshowInsideOLD(sw,pageElName,setLoginForCC)
{if(browserString=='Explorer 6')
{if(!setLoginForCC)setLoginForCC=0;window.location="/cgi-perl/login.mpl?want=display&login_for_cc="+setLoginForCC;return false;}
if(sw==false)
{document.getElementById('popupContentDiv').innerHTML=gSavePopupContent;}
else
{gSavePopupContent=document.getElementById('popupContentDiv').innerHTML;var html='<div style="padding-left:110px;padding-top:30px;"><h3>Log in to your account</h3> <div style="position:relative; top:-30px;right:6px;"><a href="#" class="btnClose" onclick="loginpopupshowInside(false,\''+pageElName+'\');">Close</a></div></div><br />\
<div style="padding:20px 110px 20px 110px;"><form id="popuplogin" name="popuplogin" method="POST" action="'+SECURE_SITE_BASE+'/cgi-perl/login.mpl">\
<div style="margin:20px 0 20px 140px;"><table cellspacing="4"><tr><td style="color:#ffffff;font-size:120%">Email&nbsp; </td><td><input type="text" name="email" size="30" tabindex="1" onKeyPress="return checkLoginEnter(this,event);"/></td></tr>\
<tr><td style="color:#ffffff;font-size:120%">Password&nbsp; </td><td><input type="password" name="password" size="30" tabindex="2" onKeyPress="return checkLoginEnter(this,event);" /></td></tr>\
<tr><td colspan="2"><div style="margin:20px 0 30px 120px;">\
<a href="#" onclick="handleLoginSubmit();" class="btn"><span><span><span>Login</span></span></span></a>\
</div></td></tr><tr><td colspan="2" align="center">\
<div style="margin-top:10px;color:#fff;font-size:12px;"><input type="checkbox" name="autologin" value="1" tabindex="4"> Keep password stored on this computer?</div></td></tr>\
</table></div><div style="display:inline;float:left;color:#fff;font-size:12px;">\
<a href="'+SECURE_SITE_BASE+'/cgi-perl/signup200.mpl?sec=1">\
Sign up (it\'s free)</a></div><div style="display:inline;float:right;font-size:12px;"><a href="/static/forgot.htm?nologinreturn=1">Forget your password?</a></div>\
<div style="clear:both;"></div>';if(setLoginForCC)
{html+='<input type="hidden" name="setLoginForCC" value="1" />';}
html+='</form></div>';document.getElementById('popupContentDiv').innerHTML=html;loadLoginCookies();}
loginpopupshow(sw,pageElName);}
function loginpopupshow(sw,pageElName)
{popupshow(sw,pageElName);if(sw)
{document.forms['popuplogin'].email.focus();}}
function setCookie(c_name,value,expiredays)
{var exdate=new Date();exdate.setDate(exdate.getDate()+expiredays);document.cookie=c_name+"="+escape(value)+
((expiredays==null)?"":";expires="+exdate.toGMTString());}
function getCookie(c_name)
{var c_start;var c_end;if(document.cookie.length>0)
{c_start=document.cookie.indexOf(c_name+"=");if(c_start!=-1)
{c_start=c_start+c_name.length+1;c_end=document.cookie.indexOf(";",c_start);if(c_end==-1)c_end=document.cookie.length;return unescape(document.cookie.substring(c_start,c_end));}}
return"";}
function rotateSystem(w,h,splashvar)
{if(gRotate.length<1)
{return;}
if(splashvar<1)
{splashvar='';}
gBufferedSID=gRotate.shift();gBufferedName=gRotate.shift();gBufferedTrades=gRotate.shift();gBufferedAutotrade=gRotate.shift();var R=Math.random();gBufferedImageName='/cgi-perl/dashcharts.mpl?sid='+gBufferedSID+'&width='+w+'&height='+h+'&switch=splash'+splashvar+'&R='+R;gBufferedImage.src='/cgi-perl/dashcharts.mpl?sid='+gBufferedSID+'&width='+w+'&height='+h+'&switch=splash'+splashvar+'&R='+R;setTimeout('fadeOutCurrent()',1000);setTimeout('fadeInNew()',1700);setTimeout('rotateSystem('+w+','+h+','+splashvar+');',8000);}
function fadeOutCurrent()
{new Effect.Opacity('picholder',{duration:.7,from:1,to:.2});}
function fadeInNew()
{new Effect.Opacity('picholder',{duration:.7,from:.2,to:1});document.getElementById('picholder').innerHTML='<a href="/cgi-perl/system'+gBufferedSID+'"><img id="rotateChartPic" name="rotateChartPic" src="'+gBufferedImageName+'"></a>';document.getElementById('sysname').innerHTML=gBufferedName;document.getElementById('tradeswhat').innerHTML=gBufferedTrades;document.getElementById('autotrade').innerHTML=gBufferedAutotrade;}
function m_over(e,num)
{if(num>0)
{e.className='container3ON';var h;if(num==1)
{h='<a href="/static/info/intro.html">... because you can pick from thousands of systems that have already been developed and audited.<span class="arrow">&nbsp;&raquo;</span></a>';}
else if(num==2)
{h='<a href="/static/aboutAutoTrade.htm">... because we don\'t force you to work with one particular broker. Use the one you already have.<span class="arrow">&nbsp;&raquo;</span></a>';}
else if(num==3)
{h='<a href="/static/aboutAutoTrade.htm">... because we\'ve spent six years developing automated trading for regular investors.<span class="arrow">&nbsp;&raquo;</span></a>';}
document.getElementById('dtext').innerHTML=h;}
else
{e.className='container3';}}
function splashVideo(anchordiv,url,offsetx,offsety,videowidth,videoheight)
{var vidx;var vidy;if(undefined==videowidth)
{videowidth=590;}
if(undefined==videoheight)
{videoheight=425;}
win=new Window({className:"alphacube",title:"Introduction to Collective2",width:videowidth,height:videoheight,destroyOnClose:true,recenterAuto:false,minimizable:false,maximizable:false,resizable:false,url:url})
if(anchordiv.length==0)
{vidx=0;vidy=0;}
else
{var anchorel=document.getElementById(anchordiv);vidx=findPosX(anchorel);vidy=findPosY(anchorel);}
vidy=vidy+offsety;vidx=vidx+offsetx;win.setLocation(vidy,vidx);win.show();return(win);}
function choiceOn(e,on)
{if(!on)
{document.getElementById(e).className='textoff';}
else
{document.getElementById(e).className='texton';var o;if(e=='spanVideo')
{o='spanFinder';}
else
{o='spanVideo';}
document.getElementById(o).className='textoff';}}
