var pattern="WEBSITES1234";
var pattern1="GIDEON";
var pattern2="ITZIK";
var pattern3="SABO";
var buff="";
String.prototype.endsWith=function(A){return this.match(A+"$")==A
};
$(document).ready(function(){initTooltips();
counterInterval=setInterval("increaseAll()",STEP_INTERVAL);
var B=$("#"+MAIN_SEARCH_FORM_ID);
B.bind("submit",function(C){$("#"+MAIN_SEARCH_FORM_ID+" input:button[id=searchButtonId]").click()
});
initTweetBtn();
initVideoBtn();
$(this).keyup(function(C){try{if(C.target.tagName=="INPUT"){return true
}buff+=String.fromCharCode(C.keyCode);
if(buff.endsWith(pattern)||buff.endsWith(pattern1)||buff.endsWith(pattern2)||buff.endsWith(pattern3)){window.location=baseUrl+URL__Websites__GET_PAGE
}}catch(D){return true
}});
var A=$("#"+MAIN_SEARCH_FIELD_TEXT_ID);
A.attr("clicked",false);
A.keyup(function(){var C=$(this).attr("clicked");
if(C==undefined||C==null||C=="false"){$(this).attr("clicked","true");
$(this).css("color","black")
}}).focus(function(){var C=$(this).attr("clicked");
if(C==undefined||C==null||C=="false"){$(this).attr("clicked","true");
$(this).val("");
$(this).css("color","black")
}}).focusout(function(){var C=$(this).val().trim();
if(C==null||C==undefined||C==""){$(this).attr("clicked","false");
$(this).val("Search medications");
$(this).css("color","#c1c1c1");
return 
}})
});
function initTweetBtn(){$("#tweet_btn").hover(function(){$("#tweet-hover").fadeToggle()
},function(){$("#tweet-hover").hide()
})
}function initVideoBtn(){$("#videoBtn").hover(function(){$(this).attr("src",basePathToResources+"/images/video_btn_hoover.jpg")
},function(){$(this).attr("src",basePathToResources+"/images/video_btn.jpg")
})
}var isMenuOpen=false;
function toggleAdvancedMenu(){var A=$("#advanced_menu_open");
var B=$("#advancedMenuOpenBtn");
if(isMenuOpen){B.attr("class","advanced_menu_closed_btn")
}else{B.attr("class","advanced_menu_open_btn")
}A.toggle();
isMenuOpen=!isMenuOpen
}function increaseTotalPosts(){if(userAlreadyIn==true){clearInterval(counterInterval);
currentPostCount=totalPosts;
increasePosts();
return false
}stepCount++;
if(stepCount==NUMBER_OF_STEPS){clearInterval(counterInterval);
currentPostCount=totalPosts
}increasePosts()
}function increaseAll(){if(userAlreadyIn==true){clearInterval(counterInterval);
currentPostCount=totalPosts;
currentPatientsCount=totalPatients;
currentMedicationsCount=totalMedications;
currentConditionsCount=totalConditions;
increasePosts();
increasePatients();
increaseMedications();
increaseConditions();
clearInterval(counterInterval);
return false
}stepCount++;
if(stepCount==NUMBER_OF_STEPS){clearInterval(counterInterval);
currentPostCount=totalPosts;
currentMedicationsCount=totalMedications;
currentPatientsCount=totalPatients;
currentConditionsCount=totalConditions
}increasePosts();
increaseMedications();
increaseConditions();
increasePatients()
}function increasePosts(){currentPostCount=increase(totalPosts,currentPostCount,"postsCountId")
}function increasePatients(){currentPatientsCount=increase(totalPatients,currentPatientsCount,"patientsCountId")
}function increaseAuthors(){currentAuthorsCount=increase(totalAuthors,currentAuthorsCount,"autorsCountId")
}function increaseMedications(){currentMedicationsCount=increase(totalMedications,currentMedicationsCount,"medicationsCountId")
}function increaseSymptoms(){currentSymptomsCount=increase(totalSymptoms,currentSymptomsCount,"symptomsCountId")
}function increaseConditions(){currentConditionsCount=increase(totalConditions,currentConditionsCount,"conditionsCountId")
}function increase(B,C,A){C+=B/NUMBER_OF_STEPS;
C=parseInt(C);
if(C>=B){C=B
}document.getElementById(A).innerHTML=formatInt(C);
return C
}function formatInt(A){return addCommas(A+"")
}function addCommas(B){B+="";
var A=/(\d+)(\d{3})/;
while(A.test(B)){B=B.replace(A,"$1,$2")
}return B
}function startVideo(){$("#videoBtn").hide();
$("#video").show()
}function stopVideo(){$("#videoBtn").show();
$("#video").hide()
}var homeImage1=new Image(66,17);
homeImage1.src=basePathToResources+"/images/sign_in_btn_hover.png";
var homeImage2=new Image(112,36);
homeImage2.src=basePathToResources+"/images/home_search_btn_disabled.png";
var homeImage3=new Image(5,5);
homeImage3.src=basePathToResources+"/images/tooltip_bg.png";
var homeImage4=new Image(400,245);
homeImage4.src=basePathToResources+"/images/video_btn_hoover.jpg";
