
function navigateWithReferrer(url)
{var tempLink=document.createElement("a");if(typeof(tempLink.click)=='undefined')
location.href=url;else
{tempLink.href=url;document.body.appendChild(tempLink);tempLink.click();}}
$(document).ready(function(){if($.browser.msie){$(".companyNameData a").css('display','inline');$(".companyNameData a").css('cursor','hand');$(".companyNameData a").hover(function(){$(this).css('textDecoration','underline');},function(){$(this).css('textDecoration','none');});}});
;

function embedMonsterVideo(width,height,imageFile,videoFile,urlBase,videoDiv)
{var myDiv=document.getElementById(videoDiv);myDiv.innerHTML="<a href='javascript:;'><img width='"+width+"' height='"+height+"' border='0' src='"+imageFile+"' onclick='javascript:loadVideoPlayer(\""+width+"\", \""+height+"\", \""+videoFile.toLowerCase()+"\", \""+urlBase+"\", \""+videoDiv+"\");' /></a>";return false;}
function loadVideoPlayer(width,height,videoFile,urlBase,videoDiv)
{var fvars={};var params={};var attributes={};if(urlBase.substr(0,7)=='rtmp://'){fvars.config="{autoPlay:true, controlsOverVideo:'ease' , loop:false, initialScale: 'scale', autoBuffering: true, bufferLength: 5, showFullScreenButton: false, showMenu: false, menuItems: [ 0, 0, 0, 0, 0, 0, 0 ], streamingServerURL: '"+urlBase+"', playList: [{ url: '"+videoFile+"'}] }";}else{fvars.config="{autoPlay:true, controlsOverVideo:'ease' , loop:false, initialScale:'scale', autoBuffering:true, bufferLength:5, showFullScreenButton:false, showMenu:false, menuItems:[ 0, 0, 0, 0, 0, 0, 0 ], videoFile:'"+urlBase+"/"+videoFile+".flv' }";}
params.allowScriptAccess="always";params.allowFullScreen="false";params.wmode="opaque";swfobject.embedSWF("http://media.newjobs.com/mm/redux/headboard/swf/FlowPlayerLight.swf",videoDiv,width,height,"9.0.0",false,fvars,params,attributes);}
;

function hasHJCookie(){if(getCookie('YTA')){return true;}
return false;}
function getCookie(name){var cookies=document.cookie;if(cookies.indexOf(name+"=")!=-1){var startpos=cookies.indexOf(name+"=")+name.length+1;var endpos=cookies.indexOf(";",startpos)-1;if(endpos<0)endpos=cookies.length;return unescape(cookies.substring(startpos,endpos));}
return false;}
function registerHotJobsMouseClickEventHandler(){if(hasHJCookie()){logHJBind("mousedown","logHJHandler");}}
function logHJBind(event,func){if((typeof(window[func])=="function")&&document.body){if(document.body.addEventListener){document.body.addEventListener(event,window[func],true);}
else if(document.body.attachEvent){document.body.attachEvent("on"+event,window[func]);}}}
function logHJHandler(evt){evt=evt||(window.event||"");if(evt&&evt.type&&(evt.type=="mousedown")){trackHJ(evt);}
return true;}
function trackHJ(e){if(!e)var e=window.event;var linkTag=mnsEvt(e,"A");if(!linkTag)linkTag=mnsEvt(e,"a");if(!linkTag)linkTag=mnsEvt(e,"AREA");if(!linkTag)linkTag=mnsEvt(e,"area");if(!linkTag)return true;var cName='';var metaInfo=$('meta[name|=y_cmpny]');if(metaInfo&&metaInfo[0])
{cName=metaInfo[0].content;}
var yta='';if(getCookie('YTA')){yta=getCookie('YTA');}
if(linkTag.href.indexOf('mailto:')!=-1){dcsMultiTrack('DCS.dcssip',document.domain,'DCS.dcsuri','/mailto.click','DCSext.y_action','c_email','DCSext.y_cmpny',cName,'DCSext.yta',yta);}
else if(linkTag.href.length>0&&linkTag.href.indexOf("monster.com")==-1&&linkTag.href.indexOf("monster.ca")==-1&&linkTag.href.indexOf("hotjobs.com")==-1&&linkTag.href.indexOf("hotjobs.ca")==-1){dcsMultiTrack('DCS.dcssip',document.domain,'DCS.dcsuri',window.location.pathname,'DCSext.y_action','c_elink','DCSext.y_cmpny',cName,'DCSext.yta',yta);}
return true;}
function mnsEvt(evt,tag){var e=evt.target||evt.srcElement;while(e.tagName&&(e.tagName!=tag)){e=e.parentElement||e.parentNode;}
if(e.tagName&&e.tagName==tag)return e;else return false;}
;

_g.namespace('_s.content').ShowHideSocialBookmarkModal=function(){$(document.body).bind("click",function(e){var $target=$(e.target);if($target.is(".shareLink span")){e.preventDefault();$("#socialBookmarkModal").delay(100).fadeIn(200);}else if($target.is("#anchorClose")){e.preventDefault();$("#socialBookmarkModal").delay(100).fadeOut(300);}else if(!$target.is("#socialBookmarkModal")){$("#socialBookmarkModal").delay(100).fadeOut(300);}});};
;

function registerLinkButton(cId,bId)
{var oC=$('#'+cId);var oB=$('a#'+bId);if(typeof(oC)!=='undefined'&&typeof(oB)!=='undefined')
{oC.bind('keydown',function(e)
{fireLinkButton(e,oB);});}}
function fireLinkButton(e,lBtn)
{if(!e.which&&!e.keyCode&&!e.charCode)
{return;}
else
{var k=(e.which||e.keyCode||e.charCode);try
{if(k===13)
{e.preventDefault();e.stopPropagation();location.href=lBtn.attr('href');return false;}}
catch(err)
{return false;}}}
;

$(document).ready(function(){$(".profileHtmlHeader").click(function(event){$(this).addClass("activeProfileTab");var selected=$("span[class$='activeProfileTab']");var arractiveProfileTab=$.makeArray(selected);var aIndex=$(arractiveProfileTab).index($(this));var prev=aIndex-1;var next=aIndex+1;if(aIndex==1){$(arractiveProfileTab[prev]).removeClass("activeProfileTab");}
else
{$(arractiveProfileTab[next]).removeClass("activeProfileTab");}});});
;

$(document).ready(function(){$("div.wdgDetails").each(function(){var list=$(this);var size=10;var current_size=0;list.children().each(function(){if(++current_size>size){var new_list=$("<div class='wdgDetails'></div>").insertAfter(list);list=new_list;current_size=1;}
list.append(this);});});$("div.browseContent").each(function(){var list=$(this);var size=15;var current_size=0;list.children().each(function(){if(++current_size>size){var new_list=$("<div class='browseContent'></div>").insertAfter(list);list=new_list;current_size=1;}
list.append(this);});});$(".wdgTopCompaniesSeparator:eq(0)").css("border-top","none");});
;

_g.namespace('_s.company').popUpLayer=function(){this.containerID=null;this.followDiv=null;this.followingDiv=null;this.watchListDiv=null;this.sizeLabel=null;this.followButton=null;this.followingButton=null;this.count=0;this.maxcount=0;this.mode=0;this.current_pid=0;var me=this;this.init=function(mode,containerID,followDiv,followingDiv,watchListDiv,sizeLabel,count,maxcount,current_pid){this.mode=mode;this.containerID=containerID;this.followDiv=followDiv;this.followingDiv=followingDiv;this.watchListDiv=watchListDiv;this.sizeLabel=sizeLabel;this.count=count;this.maxcount=maxcount;this.current_pid=current_pid;$("#"+this.containerID).bgiframe({src:"#"});}
this.setClass=function(mode)
{$("#"+this.containerID).removeClass("FollowMode FollowingMode WatchlistMode");$("#"+this.containerID+" .smHeader").removeClass("smNoTitle");if(mode==1){$("#"+this.containerID).addClass("FollowMode");$("#"+this.containerID+" .smHeader").addClass("smNoTitle");$("#"+me.followDiv).css("display","block");$("#"+me.followButton).css("display","block");$("#"+me.followingDiv).css("display","none");$("#"+me.followingButton).css("display","none");$("#"+me.watchListDiv).css("display","none");$("#"+this.containerID).css("width","");if(me.count>=me.maxcount){$(".FollowBody").css("display","none");$(".FollowBodyListFull").css("display","block");}
else{$(".FollowBody").css("display","block");$(".FollowBodyListFull").css("display","none");}}
else if(mode==2){$("#"+this.containerID).addClass("FollowingMode");$("#"+this.containerID+" .smHeader").addClass("smNoTitle");$("#"+this.followDiv).css("display","none");$("#"+this.followButton).css("display","none");$("#"+this.followingDiv).css("display","block");$("#"+this.followingButton).css("display","block");$("#"+this.watchListDiv).css("display","none");$("#"+this.containerID).css("width","");}
else if(mode==3){$("#"+this.containerID).addClass("WatchlistMode");$("#"+this.watchListDiv).css("display","block");$("#"+this.followDiv).css("display","none");$("#"+this.followingDiv).css("display","none");$("#"+this.containerID).css("width","360px");$("#"+this.sizeLabel).html("&nbsp;("+this.count+")");}}
this.launch=function(openerID,followButton,followingButton,yDelta){this.setClass(this.mode);this.followButton=followButton;this.followingButton=followingButton;$("#"+this.containerID).css(this.offset(openerID,yDelta));$("#"+this.containerID).show();}
this.hide=function(){$("#"+this.containerID).hide();}
this.offset=function(openerID,yDelta){var yd=yDelta||0;var offset=$("#"+openerID).offset();offset.top=offset.top+yd;offset.left=offset.left-($("#"+this.containerID).width()-$("#"+openerID).width());return offset;}
this.isVisible=function(){return $("#"+this.containerID).css("display")=="block";}
this.windowSize=function(){var dimensions={width:0,height:0};dimensions.width=$(window).width()+$(window).scrollLeft();dimensions.height=$(window).height()+$(window).scrollTop();return dimensions;}
this.openWatchList=function(){_s.services.post('UserCompanyWatchList/retrieve',{},this.OnWatchList);}
this.addToCompWatchList=function(profileId){if(this.count<this.maxcount){this.count=this.count+1;_s.services.post('UserCompanyWatchList/addProfile',{'companyProfileId':profileId},this.onAdded);}}
this.removeFromCompWatchList=function(profileId){if(this.current_pid==profileId){this.mode=1;$("#"+this.followingButton).css("display","none");$("#"+this.followButton).css("display","block");}
this.count=this.count-1;_s.services.post('UserCompanyWatchList/RemoveProfile',{'companyProfileId':profileId},this.onRemoved);}
this.onRemoved=function()
{me.openWatchList();}
this.onAdded=function(){me.mode=2;me.setClass(me.mode);}
this.OnWatchList=function(result){me.setClass(3);$("#"+me.watchListDiv+" .FollowCompanyList").html(result.WatchList);$("#"+me.watchListDiv+" .footer").addClass("fnt1");$("#"+me.watchListDiv+" .remove a").click(function(e){e.preventDefault();me.removeFromCompWatchList(e.target.getAttribute('mns_pid'));});}};function removeFromCompWatchList(profileId)
{_s.services.post('UserCompanyWatchList/RemoveProfile',{'companyProfileId':profileId},OnCompWatchListRemoved);}
function OnCompWatchListRemoved()
{window.location.reload();}
function addToCompWatchList(profileId)
{_s.services.post('UserCompanyWatchList/addProfile',{'companyProfileId':profileId},OnCompWatchListAdded);}
function OnCompWatchListAdded()
{window.location.reload();}
;

