var debug=false;var browser;var cur_pg="";var category="";var ecard_page="";var ecard="";var user_url="";var title;var nb_pg;var fx="";var foreground1="";var foreground2="";var width,height;var kind;var initialized=false;if(debug){document.write('<p><font color=\"#FF0000\">DEBUG MODE')}function get_browser(){browser={init:function(){this.name=this.searchString(this.dataBrowser)||"b??";this.version=this.searchVersion(navigator.userAgent)||this.searchVersion(navigator.appVersion)||"v??";this.OS=this.searchString(this.dataOS)||"os??"},searchString:function(data){for(var i=0;i<data.length;i++){var dataString=data[i].string;var dataProp=data[i].prop;this.versionSearchString=data[i].versionSearch||data[i].identity;if(dataString){if(dataString.indexOf(data[i].subString)!=-1){return data[i].identity}}else if(dataProp){return data[i].identity}}return""},searchVersion:function(dataString){var index=dataString.indexOf(this.versionSearchString);if(index==-1)return 0;return parseFloat(dataString.substring(index+this.versionSearchString.length+1))},dataBrowser:[{string:navigator.userAgent,subString:"Chrome",identity:"Chrome"},{string:navigator.userAgent,subString:"OmniWeb",versionSearch:"OmniWeb/",identity:"OmniWeb"},{string:navigator.vendor,subString:"Apple",identity:"Safari",versionSearch:"Version"},{prop:window.opera,identity:"Opera"},{string:navigator.vendor,subString:"iCab",identity:"iCab"},{string:navigator.vendor,subString:"KDE",identity:"Konqueror"},{string:navigator.userAgent,subString:"Firefox",identity:"Firefox"},{string:navigator.vendor,subString:"Camino",identity:"Camino"},{string:navigator.userAgent,subString:"Netscape",identity:"Netscape"},{string:navigator.userAgent,subString:"MSIE",identity:"Explorer",versionSearch:"MSIE"},{string:navigator.userAgent,subString:"Gecko",identity:"Mozilla",versionSearch:"rv"},{string:navigator.userAgent,subString:"Mozilla",identity:"Netscape",versionSearch:"Mozilla"}],dataOS:[{string:navigator.platform,subString:"Win",identity:"Windows"},{string:navigator.platform,subString:"Mac",identity:"Mac"},{string:navigator.userAgent,subString:"iPhone",identity:"iPhone/iPod"},{string:navigator.platform,subString:"Linux",identity:"Linux"}]};browser.init()}function decode_current_page(str){var pos=str.indexOf(".htm")-1;cur_pg=parseInt(str.substring(pos,pos+1));if(debug){document.write('<p>PAGE:');document.write(' Pos page: '+pos);document.write(', Current page: '+cur_pg)}}function decode_category(str){var left,right,pos;pos=str.indexOf("EN/pages/build.htm");if(pos==-1){pos=str.indexOf("pages/");if(pos==-1){if(isNaN(cur_pg)){right=str.indexOf(".htm")}else{right=str.indexOf(".htm")-1}left=str.indexOf("/ecards-")+1;if(left>=1){category=str.substring(left,right)}else{left=str.indexOf("/i-love-you")+1;if(left>=1){category=str.substring(left,right)}else{category="undefined"}}}else{category="single-page"}}else{category="build"}if(debug){document.write('<p>CATEGORY:');document.write(' Left: '+left);document.write(', Right: '+right);document.write(', Category: '+category)}}function decode_ecard(str){user_url=getCookie("user_url");if(user_url==null){user_url=""}if(debug){document.write('<p>User URL in cookie: '+user_url)}if(user_url==""){ecard=getCookie("ecard");if(debug){document.write('<p>Ecard in cookie: '+ecard)}if(ecard==null){var left,right;left=str.indexOf("&ecard=");if(left>=0){right=str.substring(left+7).indexOf('&');if(right==-1){ecard=str.substring(left+7)}else{ecard=str.substring(left+7,left+7+right)}}else{left=str.indexOf("EN/pages/")+9;if(str.indexOf("EN/pages/build.htm")==-1){right=str.indexOf(".htm");if(left>=9){ecard=str.substring(left,right)+".jpg"}else{ecard="undefined_in_nav2_1"}}else{ecard="undefined_in_nav2_2"}}}}if(debug){document.write('<p>USER_URL: '+user_url);document.write('<p>ECARD: '+ecard)}}function decode_ecard_page(str){var left,right;left=str.indexOf("ulybka-art/ecards-")+18;right=str.indexOf(".htm");if(left>=+18){ecard_page=str.substring(left,right);setCookie("ecard_page",ecard_page,"session")}else{left=str.indexOf("EN/pages/0-")+11;right=str.indexOf(".htm");if(left>=+11){ecard_page=str.substring(left,right);setCookie("ecard_page",ecard_page,"session")}else{left=str.indexOf("ulybka-art/image-")+17;right=str.indexOf(".htm");if(left>=+17){ecard_page=str.substring(left,right);setCookie("ecard_page",ecard_page,"session")}else{ecard_page=getCookie("ecard_page");if(ecard_page!=null){if(debug){document.write('<p>Ecard_page in cookie: '+ecard_page)}}else{ecard_page="outside"}}}}if(debug){document.write('<p>ECARD PAGE: '+ecard_page)}}function decode_size(str){width=getCookie("width");height=getCookie("height");if(debug){document.write('<p>Size in cookie: '+width+height)}if(width==null){var pos=str.indexOf("&size=");if(debug){document.write('<p>SIZE:');if(pos>=0){document.write(' Pos: '+(pos+6))}else{document.write(' NOT FOUND')}}if(pos>=0){width=Number(str.substring(pos+6,pos+9));height=Number(str.substring(pos+9,pos+12))}else{width=700;height=525}}if(debug){document.write(', Size chosen: '+width+'x'+height)}}function decode_fx(){var w,h;if((category=="single-page")||(category=="build")){fx=getCookie("fx");if(fx==null){fx="  "}}else{fx="  ";setCookie("fx","  ")}if(width>height){w=700;h=525}else if(width<height){w=525;h=700}else if(width==height){w=600;h=600}switch(fx){if(fx=="ws"){foreground1="white-stars-2.gif";foreground2=foreground1}else if(fx=="cs"){foreground1="colored-stars-2.gif";foreground2=foreground1}else if(fx=="ra"){foreground1="rain-2.gif";foreground2=foreground1}else if(fx=="gb"){if((category=="build")&&(navigator.appName.indexOf('Netscape')!=-1)){foreground1="gift-box-"+w+h+"-first-frame-2.gif";foreground2="gift-box-"+w+h+"-2.gif"}else{foreground1="gift-box-"+w+h+"-full-2.gif";foreground2=foreground1}}else if(fx=="hf"){foreground1="heart-frame-"+w+h+"-2.gif";foreground2=foreground1}else if(fx=="ff"){foreground1="flower-frame-"+w+h+"-2.gif";foreground2=foreground1}else if(fx=="hd"){if((category=="build")&&(navigator.appName.indexOf('Netscape')!=-1)){foreground1="heart-drops-"+w+h+"-first-frame-2.gif";foreground2="heart-drops-"+w+h+"-2.gif"}else{foreground1="heart-drops-"+w+h+"-full-2.gif";foreground2=foreground1}}else if(fx=="he"){if((category=="build")&&(navigator.appName.indexOf('Netscape')!=-1)){foreground1="heart-explosion-"+w+h+"-first-frame-2.gif";foreground2="heart-explosion-"+w+h+"-2.gif"}else{foreground1="heart-explosion-"+w+h+"-full-2.gif";foreground2=foreground1}}else if(fx=="fb"){if((category=="build")&&(navigator.appName.indexOf('Netscape')!=-1)){foreground1="flower-bank-"+w+h+"-first-frame-2.gif";foreground2="flower-bank-"+w+h+"-2.gif"}else{foreground1="flower-bank-"+w+h+"-full-2.gif";foreground2=foreground1}}else if(fx=="fl"){foreground1="flashing-"+w+h+"-2.gif";foreground2=foreground1}else if(fx=="sn"){foreground1="snow-"+w+h+"-2.gif";foreground2=foreground1}else if(fx=="cf"){foreground1="colored-flashing-"+w+h+"-2.gif";foreground2=foreground1}else if(fx=="ly"){if((category=="build")&&(navigator.appName.indexOf('Netscape')!=-1)){foreground1="love-you-first-frame-2.gif";foreground2="love-you-2.gif"}else{foreground1="love-you-full-2.gif";foreground2=foreground1}}else if(fx=="cr"){foreground1="colored-rotating-"+w+h+"-2.gif";foreground2=foreground1}else if(fx=="ro"){foreground1="flashing-rose-2.gif";foreground2=foreground1}else if(fx=="fh"){foreground1="flashing-hearts-2.gif";foreground2=foreground1}else if(fx=="bh"){foreground1="beating-hearts-"+w+h+"-2.gif";foreground2=foreground1}else if(fx=="ev"){foreground1="envelope-2.gif";foreground2=foreground1}else if(fx=="gf"){foreground1="gift-box-"+w+h+"-first-frame-2.gif";foreground2=foreground1}else if(fx=="fi"){foreground1="black-fire-2.gif";foreground2=foreground1}else if(fx=="h1"){foreground1="heart-in-fire-2.gif";foreground2=foreground1}else if(fx=="h2"){foreground1="glass-heart-in-fire-2.gif";foreground2=foreground1}else if(fx=="EN"){foreground1="nice-day-EN-"+w+h+"-2.jpg";foreground2=foreground1}else if(fx=="FR"){foreground1="nice-day-FR-"+w+h+"-2.jpg";foreground2=foreground1}else if(fx=="ES"){foreground1="nice-day-ES-"+w+h+"-2.jpg";foreground2=foreground1}else if(fx=="DE"){foreground1="nice-day-DE-"+w+h+"-2.jpg";foreground2=foreground1}else if(fx=="AR"){foreground1="nice-day-AR-"+w+h+"-2.jpg";foreground2=foreground1}else{foreground1="none-2.gif";foreground2=foreground1}}foreground=foreground1}function get_title(){switch(category){case"ecards-arabic":title=arabic;nb_pg=2;break;case"ecards-balgarski":title=balgarski;nb_pg=1;break;case"ecards-bengali":title=bengali;nb_pg=1;break;case"ecards-cesky":title=cesky;nb_pg=1;break;case"ecards-deutsch":title=deutsch;nb_pg=2;break;case"ecards-greek":title=greek;nb_pg=1;break;case"ecards-english":title=english;nb_pg=3;break;case"ecards-espanol":title=espanol;nb_pg=2;break;case"ecards-francais":title=francais;nb_pg=2;break;case"ecards-hebrew":title=hebrew;nb_pg=1;break;case"ecards-hindi":title=hindi;nb_pg=1;break;case"ecards-italiano":title=italiano;nb_pg=1;break;case"ecards-japanese":title=japanese;nb_pg=1;break;case"ecards-javanese":title=javanese;nb_pg=1;break;case"ecards-korean":title=korean;nb_pg=1;break;case"ecards-magyar":title=magyar;nb_pg=1;break;case"ecards-nederlands":title=nederlands;nb_pg=1;break;case"ecards-polski":title=polski;nb_pg=1;break;case"ecards-portugues":title=portugues;nb_pg=1;break;case"ecards-romana":title=romana;nb_pg=1;break;case"ecards-russkij":title=russkij;nb_pg=2;break;case"ecards-srpski":title=srpski;nb_pg=1;break;case"ecards-thai":title=thai;nb_pg=1;break;case"ecards-turkce":title=turkce;nb_pg=1;break;case"ecards-ukrajnska":title=ukrajnska;nb_pg=1;break;case"ecards-urdu":title=urdu;nb_pg=1;break;case"ecards-vietnamese":title=vietnamese;nb_pg=1;break;case"ecards-chinese":title=chinese;nb_pg=1;break;case"ecards-art":title=art;nb_pg=6;break;case"ecards-flowers":title=flowers;nb_pg=2;break;case"ecards-humor":title=humor;nb_pg=2;break;case"ecards-i-love-you":title=iloveyou;nb_pg=5;break;case"ecards-love":title=love;nb_pg=4;break;case"ecards-miscellaneous":title=miscellaneous;nb_pg=1;break;case"ecards-new":title=newc;nb_pg=2;break;case"ecards-poems":title=poems;nb_pg=1;break;case"i-love-you-translations":title=ilytransl;nb_pg=4;break;default:title="!!!";nb_pg=0;break}}function init(){if((nav1Initialized==true)&&(window.home_url!=undefined)){get_browser();decode_current_page(url);decode_category(url);decode_ecard(url);decode_ecard_page(url);decode_size(url);decode_fx();get_title();if(debug){document.write(' Title: '+title);document.write('<p>NAVIGATION:');document.write(' Home URL: '+home_url)}initialized=true}else{setTimeout("init()",250)}}init();
