function InitAndShowCreateJobPopIn(_1){
var _2=document.getElementById("CreateJobDialog");
if(_2.initialized==true){
ShowCreateJobPopIn(_1);
return false;
}
var _3=document.createElement("img");
_3.src=ImagePath+"indicator.gif";
_3.style.cssFloat="right";
_3.style.marginRight="10px";
_1.parentNode.insertBefore(_3,_1);
var _4=function(_5){
InitAndShowCreateJobPopInCB(_5,_2,_3,_1);
};
var _6=RootPath+"ajax/translatorinfo.ashx?id="+ShownTranslatorID+"&action=specgroups";
var _7=new Ajax.Request(_6,{method:"post",onSuccess:_4,onFailure:AjaxFailure});
return false;
};
function InitAndShowCreateJobPopInCB(_8,_9,_a,_b){
var _c=_8.responseText;
var _d=_9.cmbSpecialtyGroup;
FillSpecialtyGroupsDropDown(_d,_c);
_a.parentNode.removeChild(_a);
_9.initialized=true;
ShowCreateJobPopIn(_b);
};
function ShowCreateJobPopIn(_e){
var _f=document.getElementById("CreateJobDialog");
var _10=null;
if(typeof (pos)!="undefined"){
_10=pos;
}else{
_10=getElementPosition(_e);
}
_f.style.top=(_10[1]-0)+"px";
_f.style.left=(_10[0]-300)+"px";
ShowOverlay();
Effect.SlideDown(_f,{duration:0.2});
return false;
};
function HideCreateJobPopIn(){
var _11=document.getElementById("CreateJobDialog");
HideOverlay();
Effect.SlideUp(_11,{duration:0.2});
};
function CancelCreateJob(){
HideCreateJobPopIn();
return false;
};
function ShowCreateJobDialogIndicator(){
var _12=document.getElementById("CreateJobDialogIndicator");
_12.style.display="";
};
function HideCreateJobDialogIndicator(){
var _13=document.getElementById("CreateJobDialogIndicator");
_13.style.display="none";
};
function ServiceChanged(_14){
var _15=_14.options[_14.selectedIndex].value;
if(_14.options[0].value==""){
_14.options[0]=null;
}
};
function GetSpecialties(_16){
ShowCreateJobDialogIndicator();
var _17=document.getElementById("CreateJobDialog");
var _18=_16.options[_16.selectedIndex].value;
var _19=_17.cmbSpecialty;
if(_16.options[0].value==""){
_16.options[0]=null;
}
if(_18==""){
return false;
}
var _1a=function(_1b){
GetSpecialtiesCB(_1b,_19);
};
var URL=RootPath+"ajax/translatorinfo.ashx?id="+ShownTranslatorID+"&action=specialties&group="+_18;
var _1d=new Ajax.Request(URL,{method:"post",onSuccess:_1a,onFailure:AjaxFailure});
return true;
};
function GetSpecialtiesCB(_1e,_1f){
HideCreateJobDialogIndicator();
var _20=_1e.responseText;
var _21=_20.split("\r\n");
var i,_23,_24;
_1f.options.length=0;
if(_21[0]!="OK"){
alert("Error retrieving specialties:"+_21[0]);
return false;
}
for(i=1;i<_21.length;i++){
if(_21[i]!=""){
_1f.options.length+=1;
_23=_21[i].split("|");
_24=document.createElement("option");
_24.value=_23[0];
_24.text=_23[1];
_1f.options[_1f.options.length-1]=new Option(_24.text,_24.value);
}
}
return true;
};
function FillSpecialtyGroupsDropDown(_25,_26){
var _27=_26.split("\r\n");
var i,_29,_2a;
if(_27[0]!="OK"){
alert("Error retrieving specialty groups:"+_27[0]);
return false;
}
for(i=1;i<_27.length;i++){
if(_27[i]!=""){
_25.options.length+=1;
_29=_27[i].split("|");
elGroup=document.createElement("option");
elGroup.value=_29[0];
elGroup.text=_29[1];
_25.options[_25.options.length-1]=new Option(elGroup.text,elGroup.value);
}
}
};
function RegisterCreateJobControls(_2b,_2c,_2d,_2e,_2f,_30){
var _31=document.getElementById("CreateJobDialog");
_31.cmbService=document.getElementById(_2b);
_31.rfvService=document.getElementById(_2c);
_31.cmbSpecialtyGroup=document.getElementById(_2d);
_31.rfvSpecialtyGroup=document.getElementById(_2e);
_31.cmbSpecialty=document.getElementById(_2f);
_31.rfvSpecialty=document.getElementById(_30);
};
function CreateJob(_32){
var _33=document.getElementById("CreateJobDialog");
var _34=[_33.rfvService,_33.rfvSpecialtyGroup,_33.rfvSpecialty];
var _35=ExecuteValidators(_34,"CreateJobDialog");
if(!_35){
return false;
}
ShowCreateJobDialogIndicator();
var _36="Serv="+_33.cmbService.options[_33.cmbService.selectedIndex].value;
_36+="&SpecGroup="+_33.cmbSpecialtyGroup.options[_33.cmbSpecialtyGroup.selectedIndex].value;
_36+="&Spec="+_33.cmbSpecialty.options[_33.cmbSpecialty.selectedIndex].value;
var URL=RootPath+"ajax/translatorinfo.ashx?id="+ShownTranslatorID+"&action=createjob";
var _38=new Ajax.Request(URL,{method:"post",onSuccess:CreateJobCB,onFailure:AjaxFailure,postBody:_36});
return false;
};
function CreateJobCB(_39){
HideCreateJobDialogIndicator();
var _3a=_39.responseText;
var _3b=_3a.split("\r\n");
var _3c;
if(_3b[0]!="OK"){
alert("Error creating job:"+_3b[0]);
return false;
}
_3c=_3b[1];
window.location.href="/job.aspx?id="+_3c;
};
function CreateJobFromSearch(_3d,_3e){
var _3f=CreateAJAXIndicator();
_3d.parentNode.appendChild(_3f);
var _40="search="+_3e;
var _41=function(_42){
CreateJobFromSearchCB(_42,_3f);
};
var URL=RootPath+"ajax/translatorinfo.ashx?id="+ShownTranslatorID+"&action=createjobfromsearch";
var _44=new Ajax.Request(URL,{method:"post",onSuccess:_41,onFailure:AjaxFailure,postBody:_40});
return false;
};
function CreateJobFromSearchCB(_45,_46){
_46.parentNode.removeChild(_46);
var _47=_45.responseText;
var _48=_47.split("\r\n");
var _49;
if(_48[0]!="OK"){
alert("Error creating job:"+_48[0]);
return false;
}
_49=_48[1];
window.location.href="/job.aspx?id="+_49;
};
function AddToFavorites(_4a){
var _4b=function(_4c){
AddToFavoritesCB(_4c,_4a);
};
var URL=RootPath+"ajax/translatorinfo.ashx?id="+ShownTranslatorID+"&action=favorite";
var _4e=new Ajax.Request(URL,{method:"post",onSuccess:_4b,onFailure:AjaxFailure});
return false;
};
function AddToFavoritesCB(_4f,_50){
var _51=_4f.responseText;
if(_51!="OK"){
alert("Error adding to favorites:"+_51);
return false;
}
var _52=_50.parentNode;
var _53=document.createElement("span");
var _54=document.createTextNode("Added to Favorites");
_53.appendChild(_54);
_52.insertBefore(_53,_50);
_52.removeChild(_50);
};
function HookElementForExpressRegistration(_55){
var _56=$(_55);
var _57=_56.onclick;
var _58=function(){
return RequestExpressRegistration(_56);
};
_56.onclick=_58;
_56.onclickAfterExpressReg=_57;
};
function RegisterExpressRegistrationControls(_59,_5a,_5b,_5c,_5d,_5e,_5f,_60,_61,_62,_63,_64){
var _65=$("ExpressRegistrationDialog");
_65.txtExpressRegName=$(_59);
_65.txtExpressRegEmail=$(_5a);
_65.txtExpressRegPassword=$(_5b);
_65.txtExpressRegConfirmPassword=$(_5c);
_65.rfvExpressRegName=$(_5d);
_65.rfvExpressRegEmail=$(_5e);
_65.regexvExpressRegEmailFormat=$(_5f);
_65.cuvExpressRegEmailDuplicate=$(_60);
_65.rfvExpressRegPassword=$(_61);
_65.regexvExpressRegPasswordLength=$(_62);
_65.rfvExpressRegConfirmPassword=$(_63);
_65.cpvExpressRegConfirmPassword=$(_64);
};
function RequestExpressRegistration(_66){
var _67=$("ExpressRegistrationDialog");
_67.OnRegisterSuccessElement=_66;
if(UserLoggedIn&&UserIsBuyer){
ExpressRegistrationSucessCallback();
return false;
}
if(UserLoggedIn&&!UserIsBuyer){
ExpressRegistrationConvertIntoBuyer(_66);
return false;
}
if(!UserLoggedIn){
ShowExpressRegistrationPopIn(_66);
}
return false;
};
function ShowExpressRegistrationPopIn(_68){
var _69=$("ExpressRegistrationDialog");
var _6a=null;
if(typeof (pos)!="undefined"){
_6a=pos;
}else{
_6a=getElementPosition(_68);
}
_69.style.top=(_6a[1]-200)+"px";
_69.style.left=(_6a[0]-300)+"px";
ShowOverlay();
Effect.SlideDown(_69,{duration:0.2});
window.setTimeout(function(){
_69.txtExpressRegName.focus();
},250);
return false;
};
function HideExpressRegistrationPopIn(){
var _6b=$("ExpressRegistrationDialog");
HideOverlay();
Effect.SlideUp(_6b,{duration:0.2});
};
function CancelExpressRegistration(){
HideExpressRegistrationPopIn();
return false;
};
function ShowExpressRegistrationIndicator(){
$("ExpressRegistrationIndicator").style.display="block";
};
function HideExpressRegistrationIndicator(){
$("ExpressRegistrationIndicator").style.display="none";
};
function DoExpressRegistration(_6c){
var _6d=$("ExpressRegistrationDialog");
var _6e=[_6d.rfvExpressRegName,_6d.rfvExpressRegEmail,_6d.regexvExpressRegEmailFormat,_6d.rfvExpressRegPassword,_6d.regexvExpressRegPasswordLength,_6d.rfvExpressRegConfirmPassword,_6d.cpvExpressRegConfirmPassword];
var _6f=ExecuteValidators(_6e,"ExpressRegistration");
if(!_6f){
return false;
}
var _70=[_6d.cuvExpressRegEmailDuplicate];
SetValidatorsValid(_70,true);
ShowExpressRegistrationIndicator();
var _71="name="+encodeURIComponent(_6d.txtExpressRegName.value);
_71+="&email="+encodeURIComponent(_6d.txtExpressRegEmail.value);
_71+="&password="+encodeURIComponent(_6d.txtExpressRegPassword.value);
var URL=RootPath+"ajax/editprofiles.ashx?&action=expressregistration";
var _73=new Ajax.Request(URL,{method:"post",onSuccess:DoExpressRegistrationCB,onFailure:AjaxFailure,postBody:_71});
return false;
};
function DoExpressRegistrationCB(_74){
var _75=_74.responseText;
var _76=_75.substring(0,2);
var _77,_78;
var i;
HideExpressRegistrationIndicator();
var _7a=$("ExpressRegistrationDialog");
if(_76=="ER"){
_77=_75.substring(3).split("|");
for(i=0;i<_77.length;i++){
_78=_7a[_77[i]];
SetValidatorValid(_78,false);
}
return false;
}
if(_76!="OK"){
alert("Error registering:"+_75);
return false;
}
UserLoggedIn=true;
UserIsBuyer=true;
HideExpressRegistrationPopIn();
ExpressRegistrationSucessCallback();
return false;
};
function ExpressRegistrationSucessCallback(){
var _7b=$("ExpressRegistrationDialog");
_7b.OnRegisterSuccessElement.onclickAfterExpressReg();
};
function ExpressRegistrationConvertIntoBuyer(_7c){
var _7d=CreateAJAXIndicator();
_7c.parentNode.appendChild(_7d);
var _7e=function(_7f){
ExpressRegistrationConvertIntoBuyerCB(_7f,_7d);
};
var URL=RootPath+"ajax/editprofiles.ashx?action=expressregmakebuyer";
var _81=new Ajax.Request(URL,{method:"post",onSuccess:_7e,onFailure:AjaxFailure});
return false;
};
function ExpressRegistrationConvertIntoBuyerCB(_82,_83){
_83.parentNode.removeChild(_83);
UserIsBuyer=true;
ExpressRegistrationSucessCallback();
return false;
};


