var myLinkItems,pagina,isNoFollow;myLinkItems=document.location.href.split("/");pagina=myLinkItems[myLinkItems.length-1];function NoFollowString(nofollow){var myhref=document.location.href;var myhrefelem=myhref.split("/");var pagina=myhrefelem[myhrefelem.length-1];if(pagina.toLowerCase()=="homepage.aspx")nofollow=nofollow.replace("rel='nofollow'","");return nofollow;}
function validateEmail(elementValue){var emailPattern=/^[a-zA-Z0-9._-]+@[a-zA-Z0-9.-]+\.[a-zA-Z]{2,4}$/;return emailPattern.test(elementValue);}
function LTrim(value){var re=/\s*((\S+\s*)*)/;return value.replace(re,"$1");}
function RTrim(value){var re=/((\s*\S+)*)\s*/;return value.replace(re,"$1");}
function trim(value){return LTrim(RTrim(value));}
function textboxChangingFocus(mytextbox,mytext){if(mytextbox.value==mytext){mytextbox.value="";}}
function textboxChangingLostFocus(mytextbox,mytext){if(trim(mytextbox.value)==""){mytextbox.value=mytext;}}
function isNoFollow(valField){myisNoFollow="";if(pagina.toLowerCase()!="homepage.aspx"){if(valField=="Yes"){myisNoFollow="rel='nofollow'";}}
return myisNoFollow;}
function formatParag(lim1,lim2){}
function openFS(myUrl){window.open(myUrl,'','height='+(window.screen.height-60)+', width='+(window.screen.width-9)+', top=0, left=0, scrollbars=1');return;}
String.prototype.capitalize=function(){return this.replace(/\w+/g,function(a){return a.charAt(0).toUpperCase()+a.substr(1).toLowerCase();});};function signup(){var emailset=$("#youremail").val();if(validateEmail(emailset)){window.open('/gl_en/sign-up.aspx?email='+emailset,'Sign_up_MSC_Cruises_specials','status=1,width=500,height=250,toolbar=0,resizable=0');}else{window.open('/gl_en/sign-up.aspx?email=NN','Sign_up_MSC_Cruises_specials','status=1,width=500,height=250,toolbar=0,resizable=0');}}
function daysInMonth(month,year){var dd=new Date(year,month,0);return dd.getDate();}
function valCaptcha(msg){if($(".standard").val().toLowerCase()!=$(".random").val().toLowerCase()){document.getElementById('lblWrongCaptcha').innerHTML=msg;return false;}else{document.getElementById('lblWrongCaptcha').innerHTML="";}}
function valZipFields(){var riuscito=true;if($(".zipCity").val()==""){$("#emptyCity").show();riuscito=false;}else{$("emptyCity").hide();}
if($(".zipState").val()==""){$("#emptyState").show();riuscito=false;}else{$("#emptyState").hide();}
if($(".zipCountry").val()==""){$("#emptyCountry").show();riuscito=false;}else{$("#emptyCountry").hide();}
return riuscito;}
