window._hqw_querystring='/salary-widget/widget/'; var embedScript = null; var scripts = document.getElementsByTagName("script"); embedScript = scripts[scripts.length-1]; var parentNode = embedScript.parentNode; var paramlist = window._hqw_querystring.substring(window._hqw_querystring.indexOf("?")+1,window._hqw_querystring.length).split("&"); var args = {}; for(var x=0; x<paramlist.length; x++) args[paramlist[x].split("=")[0]] = paramlist[x].split("=")[1]; window._hqw_engine = { 'Create': function(args){ return new this._obj(this,args); }, '_obj' : function(baseClass,args) { this.insertionPoint = document.body; this.config = {}; for(var x in args) eval("this."+x+" = args[x];"); this.parent = baseClass; this._index = this.parent.All.length; this.args = this.parent.args; try { var test = (["v1","v2","v3"]).indexOf("v2")>-1; }catch(e){ Array.prototype.indexOf = function(needle) { for(var x=0; x<this.length; x++) if(this[x]==needle) return x; return -1; }; }; this._hqw_create = function(type, testForExisting) { var el; if(testForExisting && testForExisting.parentNode) el = testForExisting; else el = document.createElement(type); return this._hqw_el(el); }; this._hqw_el = function(query) { if(query==this._hqw_obj.prototype.undefined) return null; var selection = new Array(); for(var y in this._hqw_obj.prototype) eval("selection."+y+" = this._hqw_obj.prototype."+y+";"); if(query.nodeType || query.nodeName) selection.push(query); else if(query.constructor==Object && (query.nodeType || query.nodeName)) selection.push(query); else if((typeof(query)+"").toLowerCase().indexOf("html")>-1) selection.push(query); else if(query.constructor==String) { if(query.chatAt(0)==".") selection = document.getElementsByTagName(query.substring(1,query.length)); else if(query.chatAt(0)=="#") selection.push(document.getElementById(query.substring(1,query.length))); else selection.push(document.getElementById(query)); } for(var x=0; x<selection.length; x++) for(var y in this._hqw_obj.prototype) eval("selection[x]."+y+" = this._hqw_obj.prototype."+y+";"); selection._fullData = new Array(); for(var x=0; x<selection.length; x++) selection._fullData[x] = selection[x]; return selection; }; this._hqw_obj = function(){}; this._hqw_obj.prototype.widget = this; var newvar; this._hqw_obj.prototype.undefined = newvar; this._hqw_obj.prototype._hqw_currentCSS = ""; this._hqw_obj.prototype.attr = function(attrs){ if(this.constructor==Array) { for(var x=0; x<this.length; x++) this[x].attr(attrs); return this; } for(var x in attrs) this.setAttribute(x, attrs[x]); return this; }; this._hqw_obj.prototype.css = function(css){ if(this.constructor==Array) { for(var x=0; x<this.length; x++) this[x].css(css); return this; } css = css.replace(/opacity[\s]+:/g,"opacity:"); if(document.all && css.indexOf("opacity:")>-1) css = css.substring(0,css.lastIndexOf("opacity:")) + "filter:alpha(opacity=" + Math.round(parseFloat(css.substring(css.lastIndexOf("opacity:")+8,css.indexOf(";",css.lastIndexOf("opacity:")+8)))*100) + ")" + css.substring(css.indexOf(";",css.lastIndexOf("opacity:")+8), css.length); var styles = css.split(";"); var style; for(var x=0; x<styles.length; x++) { style = styles[x].substring(0,styles[x].indexOf(":")).replace(/[\s]+/g,""); this._hqw_currentCSS = this._hqw_currentCSS.replace(new RegExp("/"+style+":[.]+;/g"),""); } this._hqw_currentCSS += css; this.style.cssText = (this.widget.config.cssReset?this.widget.config.cssReset:"") + this._hqw_currentCSS; return this; }; this._hqw_obj.prototype.hide = function(){ if(this.constructor==Array) { for(var x=0; x<this.length; x++) this[x].hide(); return this; } if(this.style.display=="none") return this; this._hqw_oldHideCSS = null; if(this._hqw_currentCSS.indexOf("display:")>-1) this._hqw_oldHideCSS = this._hqw_currentCSS.substring(this._hqw_currentCSS.indexOf("display:")+8, (this._hqw_currentCSS+";").indexOf(";",this._hqw_currentCSS.indexOf("display:")+7)); this.style.cssText = (this._hqw_currentCSS = (this._hqw_currentCSS.replace(/display:[a-z\-]+;/g,"")+"display:none;")); return this; }; this._hqw_obj.prototype.show = function(){ if(this.constructor==Array) { for(var x=0; x<this.length; x++) this[x].show(); return this; } if(this.style.display!="none") return this; this.style.cssText = (this._hqw_currentCSS = (this._hqw_currentCSS.replace(/display:[a-z\-]+;/,"")+(this._hqw_oldHideCSS?("display:"+this._hqw_oldHideCSS+";"):""))); return this; }; this._hqw_obj.prototype.remove = function(){ if(this.constructor==Array) { for(var x=0; x<this.length; x++) this[x].remove(); return this; } if(this.parentNode) this.parentNode.removeChild(this); return this; }; this._hqw_obj.prototype.html = function(html){ if(this.constructor==Array) { for(var x=0; x<this.length; x++) this[x].html(html); return this; } if(this._hqw_currentText==this.undefined) this._hqw_currentText = ""; if(html==this.undefined) return this._hqw_currentText; this._hqw_currentText = html; this.innerHTML = this._hqw_currentText; return this; }; this._hqw_obj.prototype.put = function(newParent){ if(this.constructor==Array) { for(var x=0; x<this.length; x++) this[x].put(newParent); return this; } if(this.parentNode && this.parentNode.nodeType) this.parentNode.removeChild(this); if(newParent.first) newParent = newParent.first(); newParent.appendChild(this); return this; }; this._hqw_obj.prototype.clear = function(){ if(this.constructor==Array) { for(var x=0; x<this.length; x++) this[x].clear(); return this; } while(this.childNodes.length>0) { for(var x in this.childNodes[0]) { if(x.indexOf("_hqw_eventHandlers_")==0) { try{ delete this.childNodes[0][x]; }catch(e){} try{ this.childNodes[0][x]=null; }catch(e){} } } try{ this.widget._hqw_el(this.childNodes[0]).clear(); }catch(e){} try{ this.removeChild(this.childNodes[0]); }catch(e){} try{ delete this.childNodes[0]; }catch(e){} try{ this.childNodes[0]=null; }catch(e){} } return this; }; this._hqw_obj.prototype.choose = function(index){ return this.constructor==Array ? this[index] : this; }; this._hqw_obj.prototype.first = function(){ return this.constructor==Array ? this[0] : this; }; this._hqw_obj.prototype.last = function(){ return this.constructor==Array ? this[this.length] : this; }; this._hqw_obj.prototype.orig = function(){ for(var x=0; x<this._fullData.length; x++) { this[x] = this._fullData[x]; } return this; }; this._hqw_obj.prototype.disableAction = function(type,params){ if(this.constructor==Array) { for(var x=0; x<this.length; x++) this[x].disableAction(type,params); return this; } switch(type.toLowerCase()) { case "selection": this.handle("selectstart", function(){ return false; }); this.handle("dragbegin", function(){ return false; }); this.handle("mousedown", function(){ return 0.0; }); break; } return this; }; this._hqw_obj.prototype.handle = function(eventType, handlerFunction){ eventType = (eventType+"").toLowerCase().replace(/^on/g,""); if(this.constructor==Array) { for(var x=0; x<this.length; x++) this[x].handle(eventType,handlerFunction); return this; } var oldName = "_hqw_oldEvt_"+eventType; var evtName = "on"+eventType; var evtArr = "_hqw_evtHandlers_"+eventType; if(this[oldName]==window._hqw_undefined) { this[evtArr] = new Array(); this[oldName] = this[evtName]?this[evtName]:function(){}; this[evtName] = function(e){ if(!e) e=window.event; if(!e) return null; var evtName = e.type.substring(0,2)=="on" ? e.type.substring(2,e.type.length) : e.type; var stop = false; for(var x=0; x<this["_hqw_evtHandlers_"+evtName].length; x++) { this._hqw_tempEvt = this["_hqw_evtHandlers_"+evtName][x]; try { if(this._hqw_tempEvt(e)==false) stop = true; }catch(e){ window.setTimeout("throw(new Error(unescape('"+escape(e.message)+"'),unescape('"+e.fileName+"'),"+e.lineNumber+"));",1); } } try{ delete this._hqw_tempEvt; }catch(e){ this._hqw_tempEvt=null; } return stop==true ? this.StopEvt(e) : true; }; } this[evtArr].push(handlerFunction); this._hqw_lastResponse = handlerFunction; return this; }; this._hqw_obj.prototype.schedule = function(func, delay, repetitions){ if(this.constructor==Array) { for(var x=0; x<this.length; x++) this[x].schedule(func,delay,repetitions); return this; } if(this._hqw_schedules==this._hqw_undefined) { this._hqw_schedules = new Array(); this._hqw_activeSchedulers = 0; this._hqw_scheduleCompleted = function(id,preventDelete,timerID){ if(id==this._hqw_undefined || !this._hqw_schedules[id]) return false; this._hqw_tempSch = this._hqw_schedules[id].func; try { this._hqw_tempSch(); }catch(e){ window.setTimeout("throw(new Error(unescape('"+escape(e.message)+"'),unescape('"+e.fileName+"'),"+e.lineNumber+"));",1); } if(this._hqw_schedules[id].repetitions>0 && timerID!=this._hqw_undefined) try{ window.clearTimeout(this._hqw_schedules[timerID]); }catch(e){} if(!preventDelete) { this._hqw_activeSchedulers--; this._hqw_schedules[id] = null; if(this._hqw_activeSchedulers==0) this._hqw_schedules = new Array(); } }; } if(repetitions==this._hqw_undefined) repetitions = 1; if((this.getAttribute("id")+"").replace("undefined","")=="" || this.id=="" || this.id==this._hqw_undefined) { if(this.widget._hqw_autoID_index==this._hqw_undefined) this.widget._hqw_autoID_index = 0; this.attr({ 'id':("_hqw_"+this.widget._index+"_autoid_"+(++this.widget._hqw_autoID_index)) }); } if(repetitions==0) var timer = window.setInterval("var i=document.getElementById('"+this.id+"'); if(i) i._hqw_scheduleCompleted("+(this._hqw_schedules.length)+", true);", delay); else { var timer = new Array(); for(var x=1; x<=repetitions; x++) timer.push(window.setTimeout("var i=document.getElementById('"+this.id+"'); if(i) i._hqw_scheduleCompleted("+(this._hqw_schedules.length)+", "+(x!=repetitions)+", "+(x-1)+");", x*delay)); } this._hqw_lastResponse = { 'func' : func, 'timer' : timer, 'repetitions' : repetitions }; this._hqw_schedules.push(this._hqw_lastResponse); this._hqw_activeSchedulers++; return this; }; this._hqw_obj.prototype.unschedule = function(task){ if(this.constructor==Array) { for(var x=0; x<this.length; x++) this[x].unschedule(task); return this; } if(this._hqw_schedules==this._hqw_undefined) { this._hqw_schedules = new Array(); this._hqw_activeSchedulers = 0; this._hqw_scheduleCompleted = function(id,preventDelete){ if(id==this._hqw_undefined || !this._hqw_schedules[id]) return false; this._hqw_tempSch = this._hqw_schedules[id].func; try { this._hqw_tempSch(); }catch(e){ window.setTimeout("throw(new Error(unescape('"+escape(e.message)+"'),unescape('"+e.fileName+"'),"+e.lineNumber+"));",1); } if(!preventDelete) { this._hqw_activeSchedulers--; this._hqw_schedules[id] = null; if(this._hqw_activeSchedulers==0) this._hqw_schedules = new Array(); } }; } for(var x=0; x<this._hqw_schedules.length; x++) if(this._hqw_schedules[x]==task) this._hqw_schedules[x] = null; this._hqw_activeSchedulers--; if(task.repetitions==0) try{ window.clearInterval(task.timer); }catch(e){} else { for(var x=0; x<task.timer.length; x++) try{ window.clearTimeout(task.timer[x]); }catch(e){} } return this; }; this._hqw_obj.prototype.response = function(){ if(this.constructor==Array) { var ret = new Array(); for(var x=0; x<this.length; x++) ret[x] = this[x].response(); return ret; } if(this._hqw_lastResponse!=this._hqw_undefined) return this._hqw_lastResponse; else return false; }; this._hqw_obj.prototype.StopEvt = function(e) { if(!e) e = window.event; if(e) { try { e.stopPropagation(); }catch(err){}; try { e.preventDefault(); }catch(err){}; try { e.cancelBubble(); } catch(err){}; try { e.stopPropagation = true; }catch(err){} try { e.preventDefault = true; } catch(err){}; try { e.cancelBubble = true; } catch(err){}; try { e.returnValue = false; } catch(err){}; } return false; }; this.AddStylesheet = function(url){ var sheets = document.getElementsByTagName("link"); for(var x=0; x<sheets.length; x++) if(sheets[x].href && sheets[x].href==url) return false; var sheet = this.setAttributes(document.createElement("link"), { 'type' : "text/css", 'rel' : "stylesheet", 'href' : url, 'media' : "screen" }); document.getElementsByTagName("head")[0].appendChild(sheet); return true; }; this.parent.All.push(this); }, 'args' : args, 'parentNode' : parentNode, 'embedScript' : embedScript, 'All' : (window._hqw_engine!=null ? window._hqw_engine.All : new Array()) };var swURL = "http://www.college.com/salary-widget/widget/"; var SalaryWidget = window._hqw_engine.Create({ 'insertionPoint' : window._hqw_engine.parentNode, 'config' : { 'baseClass' : "wwl_salary_widget", 'baseURL' : swURL, 'width' : window._hqw_engine.args.type=="tall" ? 178 : 306, 'height' : window._hqw_engine.args.type=="tall" ? 320 : 206, 'style' : { 'borderColor': "#B0B0A8", 'background' : "#FAFAF5", 'textColor' : "#555555", 'fontSize' : 11, 'labelColor' : "#831414", 'titleColor' : "#000000", 'titleHeight': window._hqw_engine.args.type=="tall" ? 48 : 30, 'titleBG' : "", 'menuBorder' : "#828282", 'menuBG' : "#FFFFFF", 'menuColor' : "#555555", 'calcBG' : "", 'calcWidth' : 115, 'calcHeight' : 25, 'infoColor' : "#555555", 'infoBorder' : "#000000", 'infoBG' : "#EEEEEE", 'errorColor' : "#990000", 'errorBorder': "#FF0000", 'errorBG' : "#FFFFFF", 'menuBorderError' : "#CC0000", 'codeBG' : "#FFFFFF", 'codeBorder' : "#BBBBBB", 'codeColor' : "#888888", 'copyBG' : "", 'copyWidth' : 57, 'copyHeight' : 24, 'embedBorder': "#999999", 'loadingImg' : "loading.gif" }, 'cssReset' : "float:none; clear:none; top:auto; left:auto; right:auto; bottom:auto; width:auto; height:auto; font-size:inherit; font-family:arial,helvetica,sans; font-weight:normal; line-height:normal; margin:0px 0px 0px 0px; padding:0px 0px 0px 0px; text-align:left; border:none; text-decoration:none; background:none;", 'degreeYouHave' : { 5 : { 'name' : 'Less than High School', 'enableSubjects' : false }, 6 : { 'name' : 'High School', 'enableSubjects' : false }, 1 : { 'name' : 'Associates', 'enableSubjects' : true }, 2 : { 'name' : 'Bachelors', 'enableSubjects' : true }, 3 : { 'name' : 'Masters', 'enableSubjects' : true }, 4 : { 'name' : 'PHD', 'enableSubjects' : true } } , 'degreeYouWant' : { 1 : { 'name' : 'Associates', 'enableSubjects' : true }, 2 : { 'name' : 'Bachelors', 'enableSubjects' : true }, 3 : { 'name' : 'Masters', 'enableSubjects' : true }, 4 : { 'name' : 'PHD', 'enableSubjects' : true } }, 'subjectsYouHave' : { 1 : 'Art & Design', 2 : 'Business', 3 : 'Education', 4 : 'Engineering & Construction', 5 : 'Health, Medical & Wellness', 6 : 'Hospitality & Culinary', 7 : 'Law & Criminal Justice', 8 : 'Liberal Arts & Humanities', 9 : 'Science', 10 : 'Social Science', 11 : 'Vocational', 12 : 'Technology & IT' }, 'subjectsYouWant' : { 1 : 'Art & Design', 2 : 'Business', 3 : 'Education', 4 : 'Engineering & Construction', 5 : 'Health, Medical & Wellness', 6 : 'Hospitality & Culinary', 7 : 'Law & Criminal Justice', 8 : 'Liberal Arts & Humanities', 9 : 'Science', 10 : 'Social Science', 11 : 'Vocational', 12 : 'Technology & IT' } }, 'Request' : function(url,onload) { if(this._scriptCount==null) this._scriptCount = 0; this._scriptCount++; var cid = this._scriptCount+Math.floor(Math.random()*99999999999); url += (url.indexOf("?")>-1 ? "&" : "?") + "cid="+cid; if(window.location&&window.location.base) url += "&referral_url="+window.location.base; var callback = function(cid,responseText) { var script = null; var scripts = document.getElementsByTagName("script"); for(var x=0; x<scripts.length; x++) if(scripts[x].src && scripts[x].src.indexOf("cid="+cid)>-1) script = scripts[x]; if(script==null) return false; script._parentWidget._tempScriptLoad = script._onload; script._parentWidget._tempScriptLoad(responseText); script._parentWidget._tempScriptLoad = null; script.parentNode.removeChild(script); eval("window._request_callback_"+cid+" = null;"); }; eval("window._request_callback_"+cid+" = callback;"); var script = document.createElement('script'); script._parentWidget = this; script._onload = onload ? onload : function(){}; script.src = url; script.type = 'text/javascript'; if(navigator.userAgent.indexOf('Safari')) script.charset = 'utf-8'; document.getElementsByTagName('head')[0].appendChild(script); return script; } }); SalaryWidget.init = function(optionalThemeData) { this.objSize = function(obj) { var count = 0; for(var x in obj) count++; return count; }; if(optionalThemeData && optionalThemeData.constructor==Object) { var theme = optionalThemeData[this.args.theme]; if(theme) { for(var arg in theme.style) if(this.config.style[arg]!=null && theme.style[arg]!="undefined") this.config.style[arg] = theme.style[arg]+""; } } else if(this.args.theme && this.args.theme!="undefined" && this.args.theme.toString().length >= 1) { var query = this.config.baseURL + "api.php?action=get_themes"; var request = this.Request(query, function(responseText){ var response = ""; try { response = eval("("+responseText+")"); } catch(e) { response = {'result':false}; } if(response.result==true) this.init(response.data); else { this.args.theme = null; this.init(); } }); return true; } function array_index(haystack,needle){ for(var x=0; x<haystack.length; x++)if(haystack[x]==needle)return x; return -1; }; if(this.args.degree1!=null && this.args.degree1!="undefined" && this.args.degree1.length>0) { var degrees_enabled = (this.args.degree1+"").split(","); for(var x in this.config.degreeYouHave) if(array_index(degrees_enabled, x)==-1) try{ delete this.config.degreeYouHave[x]; }catch(e){ this.config.degreeYouHave[x]=null; } } if(this.args.subject1!=null && this.args.subject1!="undefined" && this.args.subject1.length>0) { var subjects_enabled = (this.args.subject1+"").split(","); for(var x in this.config.subjectsYouHave) if(array_index(subjects_enabled, x)==-1) try{ delete this.config.subjectsYouHave[x]; }catch(e){ this.config.subjectsYouHave[x]=null; } } if(this.args.degree2!=null && this.args.degree2!="undefined" && this.args.degree2.length>0) { var degrees_enabled = (this.args.degree2+"").split(","); for(var x in this.config.degreeYouWant) if(array_index(degrees_enabled, x)==-1) try{ delete this.config.degreeYouWant[x]; }catch(e){ this.config.degreeYouWant[x]=null; } } if(this.args.subject2!=null && this.args.subject2!="undefined" && this.args.subject2.length>0) { var subjects_enabled = (this.args.subject2+"").split(","); for(var x in this.config.subjectsYouWant) if(array_index(subjects_enabled, x)==-1) try{ delete this.config.subjectsYouWant[x]; }catch(e){ this.config.subjectsYouWant[x]=null; } } if((this.args.legacy+"").toLowerCase()=="true" || this.args.legacy+""=="1") { document.write("<style type=\"text/css\" media=\"all\">div#salary_widget_tab,div#salary_widget{ display:none; }</style>"); } var isBeingRecreated = this.container!=null && this.container!="undefined" && this.container.parentNode; for(var arg in this.args) if(this.config.style[arg]!=null && this.args[arg]!="undefined" && this.args[arg].length>0) this.config.style[arg] = this.args[arg]+""; this.container = this._hqw_create("div", this.container) .css("display:block; position:relative; margin:5px auto 5px auto; border:none; background:none; font-family:arial,helvetica,sans; cursor:default; float:none; clear:both; overflow:visible; z-index:100;") .css("width:"+this.config.width+"px; height:"+this.config.height+"px; font-size:"+this.config.style.fontSize+"px; color:"+this.config.style.textColor+";") .attr({ 'id' : (this.config.baseClass+"_"+this._index) }) .handle("mouseover",function(e){ this.css("z-index:999;"); }) .handle("mouseout",function(e){ this.css("z-index:100;"); }) .handle("mousedown",function(e){ if((e.button?e.button:e.which)==2) return false; }) .handle("contextmenu",function(e){ return false; }) .first(); if(isBeingRecreated==false) this.container.put(this.insertionPoint); this.titlebar = this._hqw_create("div") .css("background:url('"+this.config.baseURL+"img/titlebar"+(this.args.type=="tall"?"-tall":"")+((this.config.style.titleBG+"").length>1?("_"+this.config.style.titleBG):"")+".gif') center bottom no-repeat; position:relative; height:"+this.config.style.titleHeight+"px; width:100%; margin:0px; padding:0px; text-align:left;") .disableAction("selection") .put(this.container) .first(); this.title = this._hqw_create("span") .css("color:"+this.config.style.titleColor+"; font-weight:bold; position:absolute; left:6px; top:5px; font-size:16px;") .html("Salary Estimator") .put(this.titlebar) .first(); this.fromwwl = this._hqw_create("span") .css("color:"+this.config.style.titleColor+"; font-size:85%; font-weight:bold; float:right; clear:both; padding:0px; padding-right:6px; padding-top:3px;") .html("From college.com") .put(this.titlebar) .first(); this.wwldir = this._hqw_create("span") .css("color:"+this.config.style.titleColor+"; font-size:85%; font-weight:normal; float:right; clear:both; padding:0px; padding-top:1px; padding-right:6px;") .html("Directory of ") .put(this.titlebar) .first(); this.wwl_linkback = this._hqw_create("a") .attr({"href":"http://www.college.com/"}) .css("color:"+this.config.style.titleColor+"; font-size:100%; font-weight:normal; cursor:pointer; text-decoration:none;") .html("Online Degrees") .put(this.wwldir) .first(); this.content = this._hqw_create("div") .css("background:"+this.config.style.background+"; display:block; position:relative; display:block; padding:0px; margin:0px; height:"+(this.config.height-this.config.style.titleHeight-1)+"px; border:1px solid "+this.config.style.borderColor+"; border-top:none;") .put(this.container) .first(); this.view = this._hqw_create("div") .css("display:block; position:relative; left:0px; top:0px; width:"+(this.content.offsetWidth-12)+"px; padding:5px; margin:0px; border:none; background:"+this.config.style.background+";") .put(this.content) .first(); this.error_message = this._hqw_create("div") .css("z-index:500; cursor:pointer; overflow:hidden; font-weight:bold; display:none; position:absolute; top:"+this.config.style.titleHeight+"px; left:5%; width:90%; text-align:center;") .css("background:"+this.config.style.errorBG+"; border:1px solid "+this.config.style.errorBorder+"; border-top-width:0px; color:"+this.config.style.errorColor+";") .html("Error") .handle("click",function(){ this.css("display:none;"); }) .put(this.container) .first(); this.loading_indicator = this._hqw_create("div") .css("z-index:900; display:none; position:absolute; top:"+this.config.style.titleHeight+"px; left:0px; width:100%; height:"+(this.container.offsetHeight-this.config.style.titleHeight)+"px; background:url('"+this.config.baseURL+"img/"+this.config.style.loadingImg+"') center no-repeat #FFFFFF; opacity:0.7;") .put(this.container) .first(); this.information_message = this._hqw_create("div") .css("z-index:901; display:none; position:absolute; top:0px; left:0px; width:100%; height:100%; background:#FFFFFF; opacity:0.7; cursor:pointer;") .handle("click",function(){ this.widget.information_message_text.hide(); this.hide(); }) .disableAction("selection") .put(this.container) .first(); this.information_message_text = this._hqw_create("div") .css("z-index:902; display:none; position:absolute; top:50%; left:5%; margin-top:-30px; padding:5px 0px; width:90%; color:#000000; background:#FFFFFF; border:1px solid "+this.config.style.infoBorder+"; text-align:center; font-weight:bold; font-size:"+(this.config.style.fontSize*1.2)+"px; cursor:pointer;") .handle("click",function(){ this.widget.information_message.hide(); this.hide(); }) .disableAction("selection") .put(this.container) .first(); this._embedSrcURL = this.config.baseURL; if(this.args.theme!=null && this.args.theme!="blue") this._embedSrcURL += (this._embedSrcURL.indexOf("?")>-1?"&amp;":"?") + "theme="+escape(this.args.theme); if(this.args.type=="tall") this._embedSrcURL += (this._embedSrcURL.indexOf("?")>-1?"&amp;":"?") + "type=tall"; this._embedCode = "<script type=\"text/javascript\" src=\""+this._embedSrcURL+"\"></script><noscript>Directory of <a href=\"http://www.college.com/\">Online Degrees</a></noscript>"; this.bottom_tools = this._hqw_create("div") .css("position:absolute; bottom:0px; left:0px; width:100%; border:none; border-top:1px solid "+this.config.style.embedBorder+"; background:none; z-index:10; overflow:visible;") .put(this.content) .first(); this.embed_explainer = this._hqw_create("span") .css("float:left; clear:none; margin:0px; padding:0px 0px 0px 5px; font-size:100%; font-weight:bold; color:"+this.config.style.textColor+";") .html("Add to your site:") .put(this.bottom_tools) .first(); this.embed_clipboard_helper = this._hqw_create("div") .css("visibility:hidden; height:0px; width:0px; overflow:hidden; position:absolute; left:0px; top:0px; z-index:0;") .put(this.bottom_tools) .first(); var embedSelectionHandler = function(){ this.focus(); try{ this.SelectAll(); }catch(e){} try{ this.select(); }catch(e){} }; this.embed_script = this._hqw_create("input") .attr({ 'type':"text" , 'value':this._embedCode }) .css("float:left; clear:none; padding:2px; margin:6px 1px 1px 4px; width:"+(this.config.width-this.config.style.copyWidth-this.embed_explainer.offsetWidth-24)+"px; font-size:100%;") .css("border:1px solid "+this.config.style.codeBorder+"; background:"+this.config.style.codeBG+"; color:"+this.config.style.codeColor+";") .handle("mouseup",embedSelectionHandler) .handle("click",embedSelectionHandler) .handle("focus",embedSelectionHandler) .handle("keydown",function(){ this.value=this.widget._embedCode; return false; }) .handle("keyup",function(){ this.value=this.widget._embedCode; return false; }) .handle("keypress",function(){ this.value=this.widget._embedCode; return false; }) .handle("mouseover",function(){ this.css("color:#000000;"); }) .handle("mouseout",function(){ this.css("color:"+this.widget.config.style.codeColor+";"); }) .put(this.bottom_tools) .first(); if(this._focus_embed_script==true) this.embed_script.focus(); this.copy_code = this._hqw_create("span") .css("display:block; position:relative; top:0px; float:right; clear:none; margin:5px 5px 0px 0px; border:none; cursor:pointer;") .css("background:url('"+this.config.baseURL+"img/copy"+((this.config.style.copyBG+"").length>0?("_"+this.config.style.copyBG):"")+".gif') center no-repeat; width:"+this.config.style.copyWidth+"px; height:"+this.config.style.copyHeight+"px;") .disableAction("selection") .handle("mousedown",function(e){ this.css("top:1px;"); window.setTimeout("document.getElementById('"+this.widget.config.baseClass+"_"+this.widget._index+"').widget.copy_code.blur();",1); return false; }) .handle("mouseup",function(e){ this.blur(); this.css("top:0px;"); }) .handle("mousemove",function(e){ this.blur(); this.css("top:0px;"); }) .handle("mouseout",function(e){ this.blur(); this.css("top:0px;"); }) .handle("click",function(e){ var flash = "<embed src=\""+this.widget.config.baseURL+"_clipboard.swf\" flashvars=\"clipboard="+escape(this.widget._embedCode)+"\" width=\"0\" height=\"0\" type=\"application/x-shockwave-flash\"></embed>"; this.widget.embed_clipboard_helper.html(flash); this.previousSibling.focus(); this.widget.ShowInformation("Code copied to clipboard."); return false; }) .put(this.bottom_tools) .first(); this.embed_customize = this._hqw_create("span") .html("Customize") .css("z-index:100; display:inline; float:none; clear:none; position:absolute; right:4px; bottom:2px; padding:0px; margin:0px; color:"+this.config.style.labelColor+"; font-weight:bold; text-decoration:underline; cursor:pointer;") .disableAction("selection") .handle("click",function(){ this.widget.GoToCustomize(); this.blur(); return false; }) .put(this.bottom_tools) .first(); this.source_explainer = this._hqw_create("div") .css("float:left; clear:both; display:block; width:100%; text-align:left; text-indent:3px; overflow:hidden; margin:0px; padding:3px 0px 2px 0px; font-size:85%; color:"+this.config.style.textColor+";") .html("Source: U.S. Bureau of Labor Statistics") .put(this.bottom_tools) .first(); if(this.args.type=="tall") { this.title.css("position:relative; display:block; top:0px; left:0px; margin:0px auto 0px auto; padding-top:2px; width:100%; text-align:center;"); this.fromwwl.css("position:relative; display:block; top:0px; left:0px; padding:0px; margin:0px; width:100%; text-align:center; font-size:85%; font-weight:normal;"); this.wwldir.css("position:relative; display:block; top:0px; left:0px; padding:0px; margin:0px; width:100%; text-align:center; font-size:85%;"); this.embed_explainer.css("display:block; float:none; width:100%; margin:0px 0px -2px 0px; padding-top:2px; text-align:center;"); this.embed_script.css("width:"+(this.config.width-this.config.style.copyWidth-24)+"px;"); this.source_explainer.css("text-align:center; text-indent:0px;"); this.embed_customize.css("position:relative; display:block; width:100%; clear:both; padding:1px 0px 0px 0px; margin:1px 0px 0px 0px; text-align:center;"); } else { this.embed_customize.css("position:absolute; right:1px; bottom:1px;"); } if(isBeingRecreated==false) this.Request( this.config.baseURL+"api.php?action=impression" ); this.GoToForm(true); if(this.degree_have_degree.disabled==true && this.degree_have_subject.disabled==true && this.degree_want_degree.disabled==true && this.degree_want_subject.disabled==true) { this.Calculate(); } }; SalaryWidget.GoToForm = function(firstTime) { this.content.css("overflow:hidden;"); if(firstTime==true) { this.view.clear(); } else { this.loading_indicator.show(); this.oldView = this.view; if(this.embedCustomizer) this.embedCustomizer.css("overflow:hidden;"); this.view = this._hqw_create("div") .css("position:absolute; top:0px; left:-"+this.content.offsetWidth+"px; width:"+(this.content.offsetWidth-12)+"px; padding:5px; border:none; background:"+this.config.style.background+";") .schedule(function(){ this.animationLeft = (this.animationLeft?this.animationLeft:(-this.widget.content.offsetWidth)) + 15; this.widget.oldView.css("left:"+(this.widget.content.offsetWidth+this.animationLeft)+"px;"); this.css("left:"+this.animationLeft+"px;"); }, 15, this.content.offsetWidth/15) .schedule(function(){ this.widget.oldView.remove(); this.css("left:0px;"); this.widget.loading_indicator.hide(); }, this.content.offsetWidth+15) .put(this.content) .first(); } var selectWidth = this.args.type=="tall" ? ((this.config.width-16)+"px") : "47%"; var selectMarginTop = this.args.type=="tall" ? 8 : 2; function degreeSelectionHandler() { for(var x=0; x<this.childNodes.length; x++) if(this.childNodes[x].selected==true) this.nextSibling.disabled = !this.childNodes[x]._enableSubjects; if(this.nextSibling.disabled==true) for(var x=0; x<this.nextSibling.childNodes.length; x++) this.nextSibling.childNodes[x].selected = (x==0); }; this.degree_have_explain = this._hqw_create("div") .css("position:relative; "+(this.args.type=="tall"?"text-align:center; margin-top:5px;":"text-align:left;")+" color:"+this.config.style.labelColor+";") .html("The degree you have:") .put(this.view) .first(); this.degree_have_degree = this._hqw_create("select") .css("float:left; clear:none; margin:"+selectMarginTop+"px 0px 2px 2px; width:"+selectWidth+"; font-size:100%; text-align:center;") .css("border:1px solid "+this.config.style.menuBorder+"; background:"+this.config.style.menuBG+"; color:"+this.config.style.menuColor+";") .handle("change",degreeSelectionHandler) .handle("focus",degreeSelectionHandler) .put(this.view) .first(); this._hqw_create("option") .attr({ 'value':'0' }) .html( " - Degree - " ) .css("text-align:left;") .put(this.degree_have_degree) .first(); var d = this.config.degreeYouHave; for(var x in d) { this._hqw_create("option") .attr({ 'value':(x+"") }) .html( d[x].name+"" ) .css("text-align:left;") .put(this.degree_have_degree) .first() ._enableSubjects = (d[x].enableSubjects==true); } if(this.objSize(d)==1) { this.degree_have_degree.childNodes[1].attr({ 'selected':"selected" }); this.degree_have_degree.attr({ 'disabled':"disabled" }); } this.degree_have_subject = this._hqw_create("select") .css("float:right; clear:none; margin:"+selectMarginTop+"px 2px 2px 0px; width:"+selectWidth+"; font-size:100%; text-align:center;") .css("border:1px solid "+this.config.style.menuBorder+"; background:"+this.config.style.menuBG+"; color:"+this.config.style.menuColor+";") .put(this.view) .first(); this._hqw_create("option") .attr({ 'value':"0" }) .html( " - Subject - " ) .css("text-align:left;") .put(this.degree_have_subject) .first(); var s = this.config.subjectsYouHave; for(var x in s) { var label = s[x]+""; label = label.replace(/&/g,"&amp;"); this._hqw_create("option") .attr({ 'value':(x+"") }) .html( label+"" ) .css("text-align:left;") .put(this.degree_have_subject) .first(); } if(this.degree_have_degree.getElementsByTagName("option").length==2 && parseInt(this.degree_have_degree.getElementsByTagName("option")[1].value)>4) { this.degree_have_subject.attr({ 'disabled':"disabled" }); } if(this.objSize(s)==1) { this.degree_have_subject.childNodes[1].attr({ 'selected':"selected" }); this.degree_have_subject.attr({ 'disabled':"disabled" }); } this.degree_want_explain = this._hqw_create("div") .css("position:relative; display:block; width:100%; float:none; clear:both; "+(this.args.type=="tall"?"text-align:center; margin-top:11px;":"text-align:left; margin-top:6px;")+" color:"+this.config.style.labelColor+";") .html("The degree you want:") .put(this.view) .first(); function selectionHandler() { for(var x=0; x<this.childNodes.length; x++) if(this.childNodes[x].selected==true) this.nextSibling.disabled = !this.childNodes[x]._enableSubjects; if(this.nextSibling.disabled==true) for(var x=0; x<this.nextSibling.childNodes.length; x++) this.nextSibling.childNodes[x].selected = (x==0); }; this.degree_want_degree = this._hqw_create("select") .css("float:left; clear:left; margin:"+selectMarginTop+"px 0px 2px 2px; width:"+selectWidth+"; font-size:100%; text-align:center;") .css("border:1px solid "+this.config.style.menuBorder+"; background:"+this.config.style.menuBG+"; color:"+this.config.style.menuColor+";") .handle("change",degreeSelectionHandler) .handle("focus",degreeSelectionHandler) .put(this.view) .first(); this._hqw_create("option") .attr({ 'value':'0' }) .html( " - Degree - " ) .css("text-align:left;") .put(this.degree_want_degree) .first(); var d = this.config.degreeYouWant; for(var x in d) { this._hqw_create("option") .attr({ 'value':(x+"") }) .html( d[x].name+"" ) .css("text-align:left;") .put(this.degree_want_degree) .first() ._enableSubjects = (d[x].enableSubjects==true); } if(this.objSize(d)==1) { this.degree_want_degree.childNodes[1].attr({ 'selected':"selected" }); this.degree_want_degree.attr({ 'disabled':"disabled" }); } this.degree_want_subject = this._hqw_create("select") .css("float:right; clear:none; margin:"+selectMarginTop+"px 2px 2px 0px; width:"+selectWidth+"; font-size:100%; text-align:center;") .css("border:1px solid "+this.config.style.menuBorder+"; background:"+this.config.style.menuBG+"; color:"+this.config.style.menuColor+";") .put(this.view) .first(); this._hqw_create("option") .attr({ 'value':"0" }) .html( " - Subject - " ) .css("text-align:left;") .put(this.degree_want_subject) .first(); var s = this.config.subjectsYouWant; for(var x in s) { var label = s[x]+""; label = label.replace(/&/g,"&amp;"); this._hqw_create("option") .attr({ 'value':(x+"") }) .html( label+"" ) .css("text-align:left;") .put(this.degree_want_subject) .first(); } if(this.degree_want_degree.getElementsByTagName("option").length==2 && parseInt(this.degree_want_degree.getElementsByTagName("option")[1].value)>4) { this.degree_want_subject.attr({ 'disabled':"disabled" }); } if(this.objSize(s)==1) { this.degree_want_subject.childNodes[1].attr({ 'selected':"selected" }); this.degree_want_subject.attr({ 'disabled':"disabled" }); } this.btn_calculate = this._hqw_create("span") .css("display:block; position:relative; top:0px; float:right; clear:both; margin:5px 5px 5px auto; border:none; cursor:pointer;") .css("width:"+this.config.style.calcWidth+"px; height:"+this.config.style.calcHeight+"px; background:url('"+this.config.baseURL+"img/calc"+((this.config.style.calcBG+"").length>0?("_"+this.config.style.calcBG):"")+".gif') center no-repeat;") .disableAction("selection") .handle("mousedown",function(){ this.style.top = "1px"; window.setTimeout("document.getElementById('"+this.widget.config.baseClass+"_"+this.widget._index+"').widget.btn_calculate.blur();",1); return false; }) .handle("mouseup",function(){ this.blur(); this.style.top = "0px"; }) .handle("mouseout",function(){ this.blur(); this.style.top = "0px"; }) .handle("mousemove",function(){ this.blur(); this.style.top = "0px"; }) .handle("click",function(){ this.widget.Calculate(); return false; }) .put(this.view) .first(); if(this.args['type']=="tall") { var tallSelectCSS = "float:none; clear:both; display:block; position:relative; margin:3px auto 7px auto;"; this.degree_have_degree.css(tallSelectCSS); this.degree_have_subject.css(tallSelectCSS); this.degree_want_degree.css(tallSelectCSS); this.degree_want_subject.css(tallSelectCSS); } }; SalaryWidget.Calculate = function() { if(this.degree_have_degree.selectedIndex == 0) return this.ShowError("Please select the degree you have.", this.degree_have_degree); else if(this.degree_have_subject.selectedIndex==0 && this.degree_have_subject.disabled!=true) return this.ShowError("Please select the subject you have studied.", this.degree_have_subject); else if(this.degree_want_degree.selectedIndex ==0) return this.ShowError("Please select the degree you want.", this.degree_want_degree); else if(this.degree_want_subject.selectedIndex==0 && this.degree_want_subject.disabled!=true) return this.ShowError("Please select the subject you wish to study.", this.degree_want_subject); function value(field){ return field.childNodes[field.selectedIndex].value; } if(value(this.degree_have_degree)==value(this.degree_want_degree) && value(this.degree_have_subject)==value(this.degree_want_subject)) return this.ShowError("Please select a different degree or subject.", this.degree_want_degree); this.loading_indicator.show(); var query = this.config.baseURL + "api.php?action=calculate" + "&deghave=" + value(this.degree_have_degree) + "&subhave=" + value(this.degree_have_subject) + "&degwant=" + value(this.degree_want_degree) + "&subwant=" + value(this.degree_want_subject) ; var request = this.Request(query, function(responseText){ var response = {'result':false , 'message':'Connection error.'}; try { response = eval("("+responseText+")"); } catch(e) { var response = {'result':false , 'message':'Connection error.'}; } if(response.result==true) this.GoToResults(response.data); else this.ShowError(response.message); }); }; SalaryWidget.GoToResults = function(data) { this.content.css("overflow:hidden;"); this.oldView = this.view; this.view = this._hqw_create("div") .css("position:absolute; top:0px; left:"+this.content.offsetWidth+"px; width:"+(this.content.offsetWidth-12)+"px; padding:0px 5px 5px 5px; border:none; background:"+this.config.style.background+";") .put(this.content) .first(); this.backLink = this._hqw_create("span") .css("clear:both; position:relative; color:"+this.config.style.labelColor+"; text-decoration:underline; font-weight:normal; font-size:100%; z-index:99; cursor:pointer;") .html("back") .disableAction("selection") .handle("mousedown",function(e){ window.setTimeout("document.getElementById('"+this.widget.config.baseClass+"_"+this.widget._index+"').widget.btn_calculate.blur();",0); return false; }) .handle("click",function(e){ this.widget.GoToForm(); return false; }) .put(this.view) .first(); var chartHeight = this.args.type=="tall" ? 140 : 85; var chartWidth = this.args.type=="tall" ? 160 : 280; var chartTopMargin = this.args.type=="tall" ? 5 : 0; var chart_wrap = this._hqw_create("div") .css("position:relative; display:block; clear:both; height:"+(chartHeight+chartTopMargin)+"px; width:"+chartWidth+"px; margin:auto; overflow:hidden;") .put(this.view) .first(); var chart_xml = "<chart bgColor='"+this.config.style.background.replace("#","")+"' animation='0' showBorder='0' numberPrefix='$' placeValuesInside='1' showToolTip='0' chartLeftMargin='0' chartRightMargin='0' chartTopMargin='"+chartTopMargin+"' chartBottomMargin='0' rotateLabels='0'>" + "<set label='Current' value='"+data.current.salary+"' showLabel='1' />" + "<set label='Potential' value='"+data.potential.salary+"' showLabel='1' />" + "</chart>"; chart_xml = chart_xml.replace(/&/g,"&amp;").replace(/</g,"&lt;").replace(/>/g,"&gt;"); if(document.all && chart_wrap.style.filter && parseFloat(navigator.appVersion)<7) { chart_wrap.html("<object width=\""+chartWidth+"\" height=\""+chartHeight+"\" classid=\"clsid:D27CDB6E-AE6D-11cf-96B8-444553540000\" codebase=\"http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=6,0,40,0\">"+ "<param name=\"movie\" value=\""+this.config.baseURL+"FusionCharts/"+(this.args.type=="tall"?"Column2D.swf":"Bar2D.swf")+"\" />"+ "<param name=\"quality\" value=\"high\" />"+ "<param name=\"wmode\" value=\"transparent\" />"+ "<param name=\"placevaluesinside\" value=\"1\" />"+ "<param name=\"showtooltip\" value=\"0\" />"+ "<param name=\"chartrightmargin\" value=\"0\" />"+ "<param name=\"charttopmargin\" value=\"0\" />"+ "<param name=\"chartleftmargin\" value=\"0\" />"+ "<param name=\"chartbottommargin\" value=\"0\" />"+ "<param name=\"rotatelabels\" value=\"0\" />"+ "<param name=\"bgColor\" value=\"#"+this.config.style.background.replace("#","")+"\" />"+ "<param name=\"flashvars\" value=\"chartWidth="+chartWidth+"&amp;chartHeight="+chartHeight+"&amp;debugMode=0&amp;registerWithJS=1&amp;scaleMode=noScale&amp;lang=EN&amp;dataXML="+chart_xml+"\" />"+ "</object>"); } else { chart_wrap.html("<embed type=\"application/x-shockwave-flash\" "+ "src=\""+this.config.baseURL+"FusionCharts/"+(this.args.type=="tall"?"Column2D.swf":"Bar2D.swf")+"\" "+ "quality=\"high\" allowscriptaccess=\"always\" wmode=\"transparent\" "+ "flashvars=\"chartWidth="+chartWidth+"&amp;chartHeight="+chartHeight+"&amp;debugMode=0&amp;registerWithJS=1&amp;scaleMode=noScale&amp;lang=EN&amp;dataXML="+chart_xml+"\" "+ "bgColor=\""+this.config.style.background.replace("#","")+"\" showborder=\"0\" numberprefix=\"$\" placevaluesinside=\"1\" showtooltip=\"0\" "+ "chartleftmargin=\"0\" chartrightmargin=\"0\" charttopmargin=\""+chartTopMargin+"\" chartbottommargin=\"0\" rotatelabels=\"0\" "+ "width=\""+chartWidth+"\" height=\""+chartHeight+"\"></embed>"); } var an = this.config.degreeYouWant[data.potential.degree].name.substring(0,1).toLowerCase()=="a" ? "an" : "a"; var difference = data.potential.salary-data.current.salary; var differenceText = (Math.abs(difference)+""); while((offset=differenceText.indexOf(",")) && (offset>3 || (offset==-1 && differenceText.length>3 && (offset=differenceText.length)))) differenceText = differenceText.substring(0,offset-3)+","+differenceText.substring(offset-3,differenceText.length); this._hqw_create("div") .html("You could make <strong>$"+differenceText+" "+(difference>0?"more":"less")+"</strong> with "+an+" <span style=\"color:"+this.config.style.labelColor+";\">"+this.config.degreeYouWant[data.potential.degree].name+" in "+this.config.subjectsYouWant[data.potential.subject].replace(/&/g,"&amp;")+"</span>.") .css("text-align:center; margin:0px 5px; line-height:1em;") .put(this.view); this.view.schedule(function(){ this.schedule(function(){ this.animationLeft = (this.animationLeft?this.animationLeft:this.widget.content.offsetWidth) - 15; this.widget.oldView.css("left:-"+(this.widget.content.offsetWidth-this.animationLeft)+"px;"); this.css("left:"+this.animationLeft+"px;"); }, 15, this.widget.content.offsetWidth/15) .schedule(function(){ this.widget.oldView.remove(); this.css("left:0px;"); this.widget.loading_indicator.hide(); }, this.widget.content.offsetWidth+15); }, 100); }; SalaryWidget.GoToCustomize = function(themeData) { if(themeData==null || themeData=="undefined") { this.loading_indicator.show(); var query = this.config.baseURL + "api.php?action=get_themes"; var request = this.Request(query, function(responseText){ var response = ""; try { response = eval("("+responseText+")"); } catch(e) { var response = {'result':false , 'message':'Connection error.'}; } if(response.result==true) this.GoToCustomize(response.data); else this.ShowError(response.message); }); return true; } this.oldView = this.view; this.view = this._hqw_create("div") .css("position:absolute; top:0px; left:"+this.content.offsetWidth+"px; width:"+(this.content.offsetWidth-12)+"px; padding:5px; border:none; background:"+this.config.style.background+"; overflow:visible;") .put(this.content) .first(); this.bottom_tools.hide(); this.backLink = this._hqw_create("span") .css("position:absolute; left:2px; top:0px; color:"+this.config.style.labelColor+"; text-decoration:underline; font-weight:normal; font-size:100%; z-index:99; cursor:pointer;") .html("back") .disableAction("selection") .handle("mousedown",function(){ window.setTimeout("document.getElementById('"+this.widget.config.baseClass+"_"+this.widget._index+"').widget.backLink.blur();",0); return false; }) .handle("click",function(){ this.widget.bottom_tools.show(); this.widget.GoToForm(); return false; }) .put(this.view) .first(); this.custom_clipboard_helper = this._hqw_create("div") .css("visibility:hidden; height:0px; width:0px; overflow:hidden; position:absolute; left:0px; top:0px; z-index:0;") .put(this.view) .first(); this.embedCustomizer = this._hqw_create("div") .css("position:absolute; left:5px; top:"+(this.backLink.offsetHeight+1)+"px; width:"+(this.view.offsetWidth-12)+"px; height:"+(this.content.offsetHeight-this.backLink.offsetHeight-10)+"px; background:#FFFFFF; border:1px solid #CCCCCC; z-index:100; overflow:hidden;") .put(this.view) .first(); this.themeDetailsCover = this._hqw_create("div") .css("position:absolute; left:0px; top:0px; width:"+this.view.offsetWidth+"px; height:"+(this.content.offsetHeight-1)+"px; background:"+this.config.style.background+"; z-index:50;") .put(this.view) .first(); this.themeDetails = this._hqw_create("div") .css("position:absolute; width:140px; height:"+(this.content.offsetHeight-25)+"px; padding:5px; background:"+this.config.style.background+"; border:1px solid "+this.config.style.borderColor+"; z-index:1;") .put(this.view) .first(); this.themeDetails.themeTitle = this._hqw_create("div") .css("font-weight:bold;") .put(this.themeDetails); this.themeDetails.themeDesc = this._hqw_create("div") .put(this.themeDetails); this.themeDetails.themeImage = this._hqw_create("img") .css("display:block; position:absolute; left:-999em; top:-999em; margin:5px auto;") .handle("load", function(){ var h = this.widget.content.offsetHeight-24; var nodes = this.widget.themeDetails.childNodes; for(var x=0; x<nodes.length; x++) if(nodes[x]!=this) h -= nodes[x].offsetHeight; this.css("width:auto; height:auto;"); if(h>0) { if(this.offsetWidth > 140) this.css("width:140px; height:"+(this.offsetHeight*140/this.offsetWidth)+"px;"); if(this.offsetHeight > h) this.css("height:"+h+"px; width:"+(this.offsetWidth*h/this.offsetHeight)+"px;"); this.css("position:relative; left:0px; top:0px;"); } }) .put(this.themeDetails); this.themeDetails.themeAuthor = this._hqw_create("div") .css("position:absolute; bottom:5px; right:5px; text-align:right; font-style:italic;") .put(this.themeDetails); this.themeDetails._animationLeft = 0; this.themeDetails._animationSpeed = 15; this.themeDetails._isOpen = false; this.themeDetails._isSliding = false; this.themeDetails._slideDir = 0; var offsetLeft = this.container.offsetLeft; var pa = this.container; while(pa && pa.parentNode && pa.parentNode!=document.body) { pa = pa.parentNode; offsetLeft += pa.offsetLeft; } if(offsetLeft<150) { this.themeDetails._animationSide = "right"; this.themeDetails.css("right:0px; border-left-width:0px;"); } else { this.themeDetails._animationSide = "left"; this.themeDetails.css("left:0px; border-right-width:0px;"); } this.SlideThemeDetails = function(direction) { if(this.themeDetails._isSliding==true && this.themeDetails._notFirst==true) { if(direction==-1) this.themeDetails._notFirst = true; if(this.themeDetails._slideDir==-direction) { this.themeDetails._slideDir = direction; this.themeDetails._animationDestination = direction>0 ? (-this.themeDetails.offsetWidth) : 0; } return false; } var wasSliding = this.themeDetails._isSliding; this.themeDetails._isOpen = false; this.themeDetails._isSliding = true; this.themeDetails._slideDir = direction; this.themeDetails._animationDestination = direction>0 ? (-this.themeDetails.offsetWidth) : 0; if(wasSliding!=true) { if(this._hideThemePreview_timer!=this.themeDetails._hqw_undefined) try{ this.themeDetails.unschedule(this._hideThemePreview_timer); }catch(e){} this.themeDetails.horizontalAnimation = function(){ var dir = this._animationLeft>this._animationDestination ? -1 : 1; if(Math.abs(this._animationLeft-this._animationDestination)<=this._animationSpeed) { this._animationLeft = this._animationDestination-dir*this._animationSpeed; this.unschedule(this.widget._hideThemePreview_timer); if(dir==1) this._isOpen = true; this._isSliding = false; if(this._onSlideOpened) this._onSlideOpened(); } this.css(this._animationSide+":"+(this._animationLeft+=dir*this._animationSpeed)+"px;"); }; this._hideThemePreview_timer = this.themeDetails.schedule(this.themeDetails.horizontalAnimation, 15, 0).response(); } }; function ShowThemePreview() { this.widget.SlideThemeDetails(1); var data = this.widget.themes[this._themeID]; var title = this.themeTitle.html(); var description = data.description ? data.description : data.about; var author = data.author ? data.author : "college.com"; var image = data.image ? data.image : data.preview; this.widget.themeDetails.themeTitle.html(title); this.widget.themeDetails.themeDesc.html(description!=null?description:""); if(image) { if(image.indexOf("://")<0) image = this.widget.config.baseURL + image; this.widget.themeDetails.themeImage.attr({ 'src' : image }).show(); } else this.widget.themeDetails.themeImage.hide(); this.widget.themeDetails.themeAuthor.html("by "+author); this.hoverCover.show(); } function HideThemePreview() { this.widget.SlideThemeDetails(-1); this.hoverCover.hide(); } this.themes = themeData; var data = null; for(var theme in themeData) { data = themeData[theme]; var wrap = this._hqw_create("div") .css("position:relative; border-bottom:1px solid #DDDDDD; text-align:right; overflow:hidden; cursor:pointer;") .css("border-left:5px solid "+data.style.labelColor+"; border-right:5px solid "+data.style.labelColor+"; background:"+data.style.background+";") .disableAction("selection") .handle("mouseover", ShowThemePreview) .handle("mouseout", HideThemePreview) .handle("click",function(e){ window._hqw_temp_RemoveSchedulers = function(el) { if(this._hqw_schedulers) for(var x=0; x<this._hqw_schedulers.length; x++) this.unschedule(this._hqw_schedulers[x]); var children = el.childNodes; for(var x=0; x<el.childNodes.length; x++) window._hqw_temp_RemoveSchedulers(el.childNodes[x]); }; window._hqw_temp_RemoveSchedulers(this.widget.container); this.widget.container.clear(); this.widget.args.theme = this._themeID; this.widget.args.legacy = null; this.widget._focus_embed_script = true; this.widget.init(); return false; }) .put(this.embedCustomizer) .first(); wrap._themeID = theme; wrap.themeTitle = this._hqw_create("div") .html( data.name?data.name:theme ) .css("padding:2px; color:#333333; font-weight:bold; text-align:left;") .put(wrap) .first(); wrap.themeAuthor = this._hqw_create("span") .html( data.author?data.author:"college.com" ) .css("position:relative; margin:0px 0px 0px auto; padding:1px; background:#EEEEEE; color:#888888; font-size:90%;") .put(wrap) .first(); wrap.hoverCover = this._hqw_create("div") .css("display:block; position:absolute; left:0px; top:0px; width:100%; height:"+wrap.offsetHeight+"px; background:"+data.style.labelColor+"; opacity:0.2; cursor:pointer;") .put(wrap) .hide() .first(); } this.view.schedule(function(){ this.schedule(function(){ this.animationLeft = (this.animationLeft?this.animationLeft:this.widget.content.offsetWidth) - 15; this.widget.oldView.css("left:-"+(this.widget.content.offsetWidth-this.animationLeft)+"px;"); this.css("left:"+this.animationLeft+"px;"); }, 15, this.widget.content.offsetWidth/15) .schedule(function(){ this.widget.oldView.remove(); this.css("left:0px;"); this.widget.content.css("overflow:visible;"); this.widget.view.css("overflow:visible;"); this.widget.embedCustomizer.css("overflow:auto;"); this.widget.loading_indicator.hide(); }, this.widget.content.offsetWidth+15); }, 100); }; SalaryWidget.ShowError = function(msg,field) { this.error_message.html(msg) .css("display:block; background:"+this.config.style.errorBG+"; border:1px solid "+this.config.style.errorBorder+"; border-top-width:0px; color:"+this.config.style.errorColor+";"); if(field==null || field=="undefined") return true; var fields = [ this.degree_have_degree, this.degree_have_subject, this.degree_want_degree, this.degree_want_subject ]; for(var x=0; x<fields.length; x++) fields[x].css("display:block; background:"+this.config.style.menuBG+"; border:1px solid "+this.config.style.menuBorder+"; color:"+this.config.style.menuColor+";"); field.handle("focus",function(){ this.css("border:1px solid "+this.widget.config.style.menuBorder+";"); this.widget.error_message.css("display:none;"); }) .css("border:1px solid "+this.config.style.menuBorderError+";"); }; SalaryWidget.ShowInformation = function(msg) { for(var x=0; x<window._hqw_engine.All.length; x++) { var widget = window._hqw_engine.All[x]; if(widget.information_message_text.html().length>1) { widget.information_message.hide(); widget.information_message_text.hide(); } } this.information_message._blinkCount = 0; this.information_message .schedule(function(){ this._blinkCount++; this._opacity=this._opacity==true?false:true; if(this._blinkCount<5) this.css("opacity:"+(this._opacity==true?"0.85":"0.7")+";"); if(this._blinkCount>=10) { this.widget.information_message_text.hide(); this.hide(); } }, 200, 10) .show(); this.information_message_text.html(msg); this.information_message_text.show(); }; SalaryWidget.init(); 