var dynPage=null;var widgetInfoObject = null;var IsWidgetLoadingInitialy  =  false;var gbl_HeaderTab = null;function ShowClassPopUp(id,name)
{var modalPopupBehavior = $find('InvitePopupBehavior');$get('divsuccesmsg').style.display='none';$get('txtMsg').innerHTML = "";$get('divPreview').style.display = 'none';$get('divMsg').style.display = '';modalPopupBehavior.show();DisplayData(id,name);$get("hdninvitorid").value=id;}
function DashBordInfoClass()
{this.ObjectTypeId;this.ObjectTypeName  ;this.Location        ;this.DefaultFeedSize ;this.MaxFeedSize     ;this.IsPagingRequired;this.IsCloseable     ;}
if (window.XMLHttpRequest)
{dynPage = new XMLHttpRequest();} 
else if (window.ActiveXObject)
{dynPage = new ActiveXObject("Microsoft.XMLHTTP");}
var defaultTitle = document.title;function Even(e)
{try
{var SenderControl;SenderControl = e.srcElement || e.target;if(SenderControl.tagName!="INPUT" && SenderControl.tagName!="SELECT" && SenderControl.tagName!="TEXTAREA" && SenderControl.tagName!="BODY")
{key = e.keyCode || e.charCode;switch(key)
{case 78:
var stknew = document.getElementById("stickyContainer1_LnkNew");stknew.click();break;case 65:
var stkall = document.getElementById("stickyContainer1_LnkShow");stkall.click();break;case 82:
var stkremdrs = document.getElementById("LnkRmnd");stkremdrs.click();break;case 83:
var stkshared = document.getElementById("Lnkshared");stkshared.click();break;case 120:
break;case 27:
Windows.closeAll();break;case 49:
case 50:
case 51:
case 52:
case 53:
case 54:
case 55:
case 56:
case 57:
SetHotkeyForChatIM(e)
break;case 45:SetMinusHotKeyForChatIM();break;case 67:
case 99:
var divChat = document.getElementById('divParentChatWindow');if(divChat.style.visibility != "visible")
{divChat.style.width ='300px';divChat.style.visibility = "visible";var rosterDivs =new Array();navigator.appName.indexOf("Microsoft")!=-1?
(document.getElementById("HeaderControl2_FrameChat").contentWindow.document.getElementById("jwc_main").contentWindow.document.getElementById("iRoster").contentWindow.hightLightUser()):
(document.getElementById("HeaderControl2_FrameChat").contentDocument.getElementById("jwc_main").contentDocument.getElementById("iRoster").contentWindow.hightLightUser())
}
else
{divChat.style.visibility = "hidden";}               
break;default:
checkKey(e);}
}
}
catch(ex)
{}
}
if (document.addEventListener)
document.addEventListener("keypress", function(e) {return Even(e) }, true);else 
document.onkeyup  = function() {Even(window.event) } ;function NewDivMessenger2(strvalue)
{NewDivMessenger(strvalue);}
var iFheight;var iFwidth;var _isIE           = false;var isSetImageCalled = true;if(navigator.appName.indexOf("Microsoft")!=-1)
_isIE=true;function autoFitContentIframe(newHeight)
{var id = 'parentFrame';if(parent.document.getElementById('parentFrame') !=  null)
{id =  'parentFrame';}
else if(parent.document.getElementById('iframeSignUp') != null)
{id =  'iframeSignUp';}
if(parent.document.getElementById(id) != null)
{if(parent.document.getElementById(id).nodeName == "IFRAME")
{var newHeight1;if (_isIE)
{if(document.frames)
{if(document.frames[id] != null)
{newHeight1=document.frames[id].window.document.body.scrollHeight;}
}
else
newHeight1=document.body.scrollHeight;}
else
{if(document.getElementById(id).contentDocument.documentElement.scrollHeight)            
newHeight1 = document.getElementById(id).contentDocument.documentElement.scrollHeight;}       
if(newHeight1<600)
newHeight1=600;if(parent.document.getElementById(id) != null)
parent.document.getElementById(id).style.height=newHeight1 + 5 + "px"
}
}   
}
function SetWindowTitle()
{var myFrame = document.getElementById('parentFrame');if(myFrame != null)
{if(myFrame.nodeName == "IFRAME")
{if(myFrame.contentWindow.document.title)
{document.title = myFrame.contentWindow.document.title;}
defaultTitle = myFrame.contentWindow.document.title;}
else
{}
}
}
function autofitIframe(id)
{var id = 'parentFrame';if(parent.document.getElementById(id) != null)
{if(parent.document.getElementById(id).nodeName == "IFRAME")
{var newHeight;if (_isIE)
{if(document.frames)
newHeight=document.frames[id].window.document.body.scrollHeight;else
newHeight=document.body.scrollHeight;}
else
{if(document.getElementById(id).contentDocument.documentElement.offsetHeight)            
newHeight = document.getElementById(id).contentDocument.documentElement.offsetHeight;}
if(newHeight<600)
newHeight=600;parent.document.getElementById(id).style.height=newHeight + 5 + "px";try{ParentProcessRequestLoader();}
catch(error){}
}
}
}
function autofitIframeForMails(id)
{var id = 'parentFrame';if(parent.document.getElementById(id) != null)
{if(parent.document.getElementById(id).nodeName == "IFRAME")
{var newHeight;if (_isIE)
{if(document.frames)
newHeight=document.frames[id].window.document.body.scrollHeight;else
newHeight=document.body.scrollHeight;}
else
{if(document.getElementById(id).contentDocument.documentElement.offsetHeight)            
newHeight1 = document.getElementById(id).contentDocument.documentElement.offsetHeight;}
if(newHeight<600)
newHeight=805;parent.document.getElementById(id).style.height=newHeight + 5 + "px";ParentProcessRequestLoader();}
}
window.scrollTo(0,0);}
function IframeChildContent() 
{if( typeof( window.innerWidth ) == 'number' ) 
{myHeight = window.innerHeight;} else if( document.documentElement && ( document.documentElement.clientWidth || document.documentElement.clientHeight ) ) 
{iFheight = document.documentElement.clientHeight;iFwidth  =  document.documentElement.clientWidth;} else if( document.body && ( document.body.clientWidth || document.body.clientHeight ) ) 
{myHeight = document.body.clientHeight;}
}
function ShowAddWidget()
{if(document.getElementById("parentFrame") != null && document.getElementById('HeaderControl2_anchorAddWidget') != null)
{if(document.getElementById("IFrameDivObj").style.display == "block")
{parent.document.getElementById('HeaderControl2_anchorAddWidget').style.display = 'none';}
else
{document.getElementById('HeaderControl2_anchorAddWidget').style.display = 'block';}
}
else if(document.getElementById('HeaderControl2_anchorAddWidget') != null)
{document.getElementById('HeaderControl2_anchorAddWidget').style.display = 'none';}
}
function DefaultDashBoardPage(currentpageName,IsDashboarCallingInit)
{if(document.getElementById("parentFrameDiv")== null)
{if(currentpageName != 'dashboardWidgets'){window.location = hostUrl + "Dashboard.aspx?navigatedfrom=" + currentpageName ;IsWidgetLoadingInitialy = false;}
else
window.location = hostUrl + "Dashboard.aspx?navigatedfrom=dashboard" ;}
else if(document.getElementById("parentFrameDiv")== null && currentpageName != 'dashboardWidgets')
{window.location = hostUrl + "Dashboard.aspx?navigatedfrom=dashboard";}
else if(currentpageName == 'dashboardWidgets')
{if(parent) 
{try 
{parent.SetStickyProperties('P',248,0,false);SetStickyUrl('dashboard.aspx');} 
catch(ex)
{}
}
gbl_HeaderTab = null;purge(document.getElementById("DivMiddleContainer"));purge(document.getElementById("DivRightContainer"));document.getElementById("DivRightContainer").innerHTML = "";document.getElementById("DivMiddleContainer").innerHTML = "";document.getElementById("parentFrameDiv").style.display = "block";if(document.getElementById('parentFrame') != null){document.getElementById('parentFrame').src  = "";}
document.getElementById("IFrameDivObj").style.display = "none";BuildHelpTextAnchor('HelpFiles/Common_Dash Board.html');ShowAddWidget();ShowDashboard();var pageMethodsExts = false;try{if(PageMethods != undefined)
{pageMethodsExts = true;}
}
catch(ex){pageMethodsExts = false;IsWidgetLoadingInitialy = true;}
if(pageMethodsExts)
{IsWidgetLoadingInitialy = false;BuildWidgets('RIGHT');var userRoleId = parseInt(document.getElementById(ctrlprefix+'Roleid').value,10);switch(userRoleId)
{case 45:
GetJobFairs('2',1,10);break;case 46:
GetJobFairs('2',1,10);break;case 47:
$get("DivJobFair").style.display = "none";break;case 20:
GetJobFairs('3',1,10);break;default:
$get("DivJobFair").style.display = "none";break;}
}
}
else
{gbl_HeaderTab = null;if(document.getElementById("parentFrame") != null)
{document.getElementById("parentFrameDiv").style.display = "none";document.getElementById('parentFrame').src  = currentpageName;document.getElementById("IFrameDivObj").style.display = "block";}
else if(document.getElementById("parentFrameDiv") != null)
{gbl_HeaderTab = null;document.getElementById("parentFrameDiv").style.display = "none";document.getElementById('parentFrame').src  = currentpageName;document.getElementById("IFrameDivObj").style.display = "block";}
}
}
var TempUrl;function BuildHelpTextAnchor(strUrl)
{TempUrl=strUrl;}
function ShowHelp()
{mywindow=window.open(TempUrl,null,"height=500,width=1000,status=yes,resizable = yes,scrollbars=yes,toolbar=no,menubar=no,location=no");mywindow.moveTo(5,20);}
function purge(d) {if(d != null)
{var a = d.attributes, i, l, n;if (a) {l = a.length;for (i = 0;i < l;i += 1) {n = a[i].name;if (typeof d[n] === 'function') {d[n] = null;}
}
}
a = d.childNodes;if (a) {l = a.length;for (i = 0;i < l;i += 1) {purge(d.childNodes[i]);}
}}
}
function ShowStickiesDiv(top, left)
{try
{if(document.getElementById('divAddWidget')!=null)
document.getElementById('divAddWidget').style.display ='none';if(left> screen.availWidth-($get('divSticky').style.pixelWidth==undefined?parseInt($get('divSticky').style.width,10):$get('divSticky').style.pixelWidth))
{left=screen.availWidth-($get('divSticky').style.pixelWidth==undefined?parseInt($get('divSticky').style.width,10):$get('divSticky').style.pixelWidth)-95;}
if($get("HeaderControl2_htxtValUser").value == "True")
{$get('divSticky').style.display = "block";$get('divSticky').style.top = top+"px";$get('divSticky').style.left = left+"px";shiftOpacity('divSticky', 1000,'Y')
}
else
{$get('divSticky').style.display = "none";}
}
catch(ex){if($get("ctl00_htxtIsAuthUser").value == "True")
{$get('divSticky').style.display = "block";$get('divSticky').style.top = top+"px";$get('divSticky').style.left = left+"px";shiftOpacity('divSticky', 1000,'Y')         
}
else
{$get('divSticky').style.display = "none";}
}
}
function HideStickiesDiv()
{try
{$get('divSticky').style.display = "none";shiftOpacity('divSticky', 1000,'n')
}
catch(ex){}
}  
function HideWidget()
{try
{shiftOpacity('divAddWidget', 1000,'n') 
}
catch(ex){}
}
function HidePageTheme(clearTimer)
{clearInterval(clearTimer);shiftOpacity('DivTheme', 2000,'n') 
var theme = document.getElementById('DivTheme');}
function ShowDashboard()
{try{PageMethods.ClearReturnUrlSession();}catch(ex){}
}
function ShowMyContactTab()
{document.getElementById('divMyContactTab').style.display = "block";document.getElementById('divTabChatMenu').style.display = "none";}
function ShowChatTab()
{document.getElementById('divMyContactTab').style.display = "none";document.getElementById('divTabChatMenu').style.display = "block";}
function ParentProcessLoader()
{ParentProcessRequestLoader('true',true);}
function __OpenMicrosite(Url)
{var width = window.screen.availWidth;var height = window.screen.availHeight;var IESite = false ;var win = window.open(Url,"_blank","width=" + width + ",height=" + height + ",left=0,top=0,status=yes,toolbar=yes,addressbar=yes,scrollbars=yes,menubar=yes,location=yes,resizable=yes");win.moveTo(0,0);}
function ScrollWindow()
{window.scrollTo(0,0);}
function SetWidgetBody()
{DefaultDashBoardPage('dashboardWidgets',true);var x = document.getElementById(ctrlprefix+"hidWidgetsIds").value;var  objDashboarInfoArray = [];if(x != "")   
{var noOfInfoObjects = x.split(',');for(i=0;i<noOfInfoObjects.length;i++){var  objDashboarInfo = new DashBordInfoClass();var p = noOfInfoObjects[i].split('*');objDashboarInfo.ObjectTypeId    = p[0];objDashboarInfo.ObjectTypeName  = p[1];objDashboarInfo.Location        = p[2];objDashboarInfo.DefaultFeedSize = p[3];objDashboarInfo.MaxFeedSize     = p[4];if(p[5] == "True" || p[5] == "true"){objDashboarInfo.IsPagingRequired     = true;}else{objDashboarInfo.IsPagingRequired     = false;}    
if(p[6] == "True" || p[6] == "true"){objDashboarInfo.IsCloseable     = true;}else{objDashboarInfo.IsCloseable     = false;}    
objDashboarInfoArray[i] = objDashboarInfo;}   
OnGetWidgetComplete(objDashboarInfoArray);}
}
function SetWidgetRelatedBodyInWidgets(){var userRoleId;userRoleId = parseInt(document.getElementById(ctrlprefix+'Roleid').value,10);switch(userRoleId){case 45:
GetJobFairs('2',1,10);break;case 46:
GetJobFairs('2',1,10);break;case 47:
$get("DivJobFair").style.display = "none";break;case 20:
GetJobFairs('3',1,10);break;default:
$get("DivJobFair").style.display = "none";break;}
CallWidgetService();}
function SetStickyProperties(ContainerType,ObjectTypeId,ObjectId,AutoShow)
{try{closeAllStickies();}catch(ex){}
$get(_CurContainerId + "_HtxtObjtype").value=ObjectTypeId;$get(_CurContainerId + "_HtxtId").value=ObjectId;$get(_CurContainerId + "_HtxtCont").value=ContainerType;if(AutoShow)
{ShowStickies(_CurContainerId);}
}
function OpenProfileView(profileId,mode)
{var width = window.screen.availWidth;var height = window.screen.availHeight;var IESite = false;if(navigator.appName.indexOf("Microsoft") != -1)
IESite = true;GridConfiguartion.SetLink(
"openmode=" + mode + "&profid=" + profileId,
function(result)
{var win = window.open("JobSeekers/ProfileView.aspx?" + result,"_blank","width=" + width + ",height=" + height + ",left=0,top=0,status=no,toolbar=no,addressbar=no,scrollbars=yes,menubar=no,location=no,resizable=yes");if(win==null)
alert("Please disable popup blocker");else
win.moveTo(0,0);});}
function OpenMicrosite(returnUrl)
{var width = window.screen.availWidth;var height = window.screen.availHeight;var IESite = false;if(navigator.appName.indexOf("Microsoft") != -1)
IESite = true;var win = window.open(returnUrl,"_blank","width=" + width + ",height=" + height + ",left=0,top=0,status=no,toolbar=no,addressbar=no,scrollbars=yes,menubar=no,location=no,resizable=yes");if(win==null)
alert("Please disable popup blocker");else
win.moveTo(0,0);}


