var info_offset = -120; try { jQuery = jQuery.noConflict(); } catch (e) { jQuery = null; } var lastItem = null; var domII=document.getElementById var ieII=document.all var crossobj; var refobj; var largeViewCounter=0; var master_asset_number=0; var image_number=0; var creditcard=-11; var state = ""; var country = ""; var xmlHttp=GetXmlHttpObject(); var usa_shipping_time; var international_shipping_time; var usa_shipping_options; var international_shipping_options; var LOWEST_SHIPPING_SERVICE; var LOWEST_SHIPPING_PRICE; var tmp=""; var uspsfreeamount=0; var ship_rates = new Array(); var detect = navigator.userAgent.toLowerCase(); var OS,browser,version,total,thestring; var shoppingAmount; var shippByUSPS; var fedexPON; var fedexSON; var ownFedexPON; var ownFedexSON; var max_char_limit=0; var max_char_obj; var lighboxInvokedFrom = ""; var currentLighbox = ""; var tmpVar = ""; var maxhightForP2 = 0; var hightForP2 = 0; var loggedIn = 0; var birth_day_history_search = 0; var is_guest = 0; var load_more_images = 1; try { var Config = {"system_languages":[{"Language":{"id":"1","language":"English","locale_name":"English","lang_code":"en","sdl_code":"eng","active":"1"}},{"Language":{"id":"2","language":"French","locale_name":"Francais","lang_code":"fr","sdl_code":"fra","active":"1"}},{"Language":{"id":"3","language":"German","locale_name":"Deutsch","lang_code":"de","sdl_code":"ger","active":"1"}},{"Language":{"id":"4","language":"Italian","locale_name":"Italiano","lang_code":"it","sdl_code":"ita","active":"1"}}],"language_prefix_exists_in_url":0,"language_code":"en","language_name":"English"}; } catch (e){ var Config = {}; } var language_code = 'en'; if(Config.language_code != undefined) { language_code = Config.language_code; } /* This fusntion runs when any page loads */ startUp(); function startUp() { document.observe("dom:loaded", function() { getBrowserInfo(); /* Unchecking all checkboxes on page load if they are more than 1*/ if(jQuery(".checkbox_child").length > 1) { jQuery(".checkbox_child").attr("checked",false); jQuery(".checkbox_main").attr("checked",false); } }); } function custome_requester(urlGC) { new Ajax.Request(urlGC, { method: 'get', onSuccess: function(transport) { } }); } function changeAmount(me,servicename) { jQuery('#Frecipient, #Fthirdparty').prop("checked", false); var tr = eval(me); if(tr>0) { var newnum=shoppingAmount+eval(me); } else { var newnum=shoppingAmount; } $('PAYPALAMT').value=newnum.toFixed(2) setsession(servicename, eval(me)) } function setsession(shippingservice, amt) { var url=SITE_URL_LAN+'shopping/setshipserviceinsession/?srvice='+shippingservice+'&amount='+amt; new Ajax.Updater( "", url, {asynchronous:true, evalScripts:true, requestHeaders:['X-Update', ""]} ); } function getBrowserInfo() { if (checkIt('konqueror')) { browser = "Konqueror"; OS = "Linux"; } else if (checkIt('safari')) browser = "Safari" else if (checkIt('omniweb')) browser = "OmniWeb" else if (checkIt('opera')) browser = "Opera" else if (checkIt('webtv')) browser = "WebTV"; else if (checkIt('icab')) browser = "iCab" else if (checkIt('msie 6.0')) browser = "Internet Explorer 6.0" else if (checkIt('msie 7.0')) browser = "Internet Explorer 7.0" else if (checkIt('msie 8.0')) browser = "Internet Explorer 8.0" else if (checkIt('msie 9.0')) browser = "Internet Explorer 9.0" else if (!checkIt('compatible')) { browser = "Netscape Navigator" version = detect.charAt(8); } else browser = "An unknown browser"; if (!version) version = detect.charAt(place + thestring.length); if (!OS) { if (checkIt('linux')) OS = "Linux"; else if (checkIt('x11')) OS = "Unix"; else if (checkIt('mac')) OS = "Mac" else if (checkIt('win')) OS = "Windows" else OS = "an unknown operating system"; } } function checkIt(string) { place = detect.indexOf(string) + 1; thestring = string; return place; } /*-----------------------------------------------------------------------------------------------*/ var Base64 = { /* private property */ _keyStr : "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=", /* public method for encoding */ encode : function (input) { var output = ""; var chr1, chr2, chr3, enc1, enc2, enc3, enc4; var i = 0; input = Base64._utf8_encode(input); while (i < input.length) { chr1 = input.charCodeAt(i++); chr2 = input.charCodeAt(i++); chr3 = input.charCodeAt(i++); enc1 = chr1 >> 2; enc2 = ((chr1 & 3) << 4) | (chr2 >> 4); enc3 = ((chr2 & 15) << 2) | (chr3 >> 6); enc4 = chr3 & 63; if (isNaN(chr2)) { enc3 = enc4 = 64; } else if (isNaN(chr3)) { enc4 = 64; } output = output + this._keyStr.charAt(enc1) + this._keyStr.charAt(enc2) + this._keyStr.charAt(enc3) + this._keyStr.charAt(enc4); } return output; }, decode : function (input) { var output = ""; var chr1, chr2, chr3; var enc1, enc2, enc3, enc4; var i = 0; input = input.replace(/[^A-Za-z0-9\+\/\=]/g, ""); while (i < input.length) { enc1 = this._keyStr.indexOf(input.charAt(i++)); enc2 = this._keyStr.indexOf(input.charAt(i++)); enc3 = this._keyStr.indexOf(input.charAt(i++)); enc4 = this._keyStr.indexOf(input.charAt(i++)); chr1 = (enc1 << 2) | (enc2 >> 4); chr2 = ((enc2 & 15) << 4) | (enc3 >> 2); chr3 = ((enc3 & 3) << 6) | enc4; output = output + String.fromCharCode(chr1); if (enc3 != 64) { output = output + String.fromCharCode(chr2); } if (enc4 != 64) { output = output + String.fromCharCode(chr3); } } output = Base64._utf8_decode(output); return output; }, _utf8_encode : function (string) { string = string.replace(/\r\n/g,"\n"); var utftext = ""; for (var n = 0; n < string.length; n++) { var c = string.charCodeAt(n); if (c < 128) { utftext += String.fromCharCode(c); } else if((c > 127) && (c < 2048)) { utftext += String.fromCharCode((c >> 6) | 192); utftext += String.fromCharCode((c & 63) | 128); } else { utftext += String.fromCharCode((c >> 12) | 224); utftext += String.fromCharCode(((c >> 6) & 63) | 128); utftext += String.fromCharCode((c & 63) | 128); } } return utftext; }, _utf8_decode : function (utftext) { var string = ""; var i = 0; var c = c1 = c2 = 0; while ( i < utftext.length ) { c = utftext.charCodeAt(i); if (c < 128) { string += String.fromCharCode(c); i++; } else if((c > 191) && (c < 224)) { c2 = utftext.charCodeAt(i+1); string += String.fromCharCode(((c & 31) << 6) | (c2 & 63)); i += 2; } else { c2 = utftext.charCodeAt(i+1); c3 = utftext.charCodeAt(i+2); string += String.fromCharCode(((c & 15) << 12) | ((c2 & 63) << 6) | (c3 & 63)); i += 3; } } return string; } } getargs=function(){ var state=document.getElementById('UsercreditcardsState').value; var country=document.getElementById('UsercreditcardsCountry').value; document.getElementById('UsercreditcardsCity').className='txtbox03'; var field='Usercreditcards'; new Ajax.Autocompleter('UsercreditcardsCity', 'UsercreditcardsCity_autoComplete', SITE_URL+'user/autocity/'+country+'/'+state+'/'+field,{}); } function submitForm(frm) { if((typeof( frm ) == "string" ) ) { var frm = $(frm); } else { var frm = frm; } frm.submit(); } function confirm_and_submitForm(frm, msg) { jSetButtonLbl("Ok", "Cancel"); jConfirm(msg, 'Confirmation', function(r) { if (r == true) { if((typeof( frm ) == "string" ) ) { var frm = $(frm); } else { var frm = frm; } frm.submit(); } else { return false; } }); } function confirm_and_send(url, msg) { jSetButtonLbl("Ok", "Cancel"); jConfirm(msg, 'Confirmation', function(r) { if (r == true) { window.location.href=url; } else { return false; } }); } function onlyNumbers(e) { var keynum; var keychar; var numcheck; if(e.keyCode == 8 || e.keyCode == 13 || e.keyCode == 37 || e.keyCode == 39 || e.keyCode == 46 || e.keyCode == 116 ) { return String.fromCharCode(keynum); } if(window.event) /* IE*/ { keynum = e.keyCode; } else if(e.which) /* Netscape/Firefox/Opera*/ { keynum = e.which; } keychar = String.fromCharCode(keynum); numcheck = /\d/; return numcheck.test(keychar); } function updateshipservice(ctr,qty) { if(isNaN($('printsizeqty_'+ctr).value)) { $('printsizeqty_'+ctr).value = 0; } if(parseInt(qty)>0 ) { var url=SITE_URL_LAN+'shopping/changeinqty/'+ctr+'/'+qty; new Ajax.Updater( "", url, {asynchronous:true, evalScripts:true, requestHeaders:['X-Update', ""]} ); } } function updateTotal4Item(e, ctr, qty, price) { var ttl = qty * price; ttl = ttl.toFixed(2); $('total4Item_'+ctr).innerHTML = ttl; if(isNaN($('printsizeqty_'+ctr).value)) { $('printsizeqty_'+ctr).value = 0; } if($('printsizeqty_'+ctr).value<=0) { $('removeChk'+ctr).checked=true; }else { $('removeChk'+ctr).checked=false; } if(parseInt(qty)>0 ) { var url=SITE_URL_LAN+'shopping/changeinqty/'+ctr+'/'+qty; new Ajax.Updater( "", url, {asynchronous:true, evalScripts:true, requestHeaders:['X-Update', ""]} ); updateShoppingCartTotals(); } } function uncheckRemoveChk( ctr ) { if($('printsizeqty_'+ctr)!=null) { if($('printsizeqty_'+ctr).value<=0) { $('removeChk'+ctr).checked=true; } } } function updateShoppingCartTotals() { var subTotal = new Number(0); var totalitems = $('totalitems').value; for(i=1;i<=totalitems;i++) { var t = $('total4Item_'+i).innerHTML var myNum=new Number(t); subTotal = subTotal + myNum; } $('subTotal').innerHTML=subTotal.toFixed(2); var srv = $('shippingservice') if (srv!==null && srv !='undefined' ) { if (srv.selectedIndex>=0) { var s=srv.options[srv.selectedIndex].text; } } var DCTotal = $('DCAmount') if (DCTotal!==null && DCTotal !='undefined' ) { var DCAmount = new Number(DCTotal.innerHTML).toFixed(2); } else { var DCAmount = new Number(0); } LOWEST_SHIPPING_PRICE = ship_rates[ $('shippingservice').value ]; if(LOWEST_SHIPPING_PRICE<0) { LOWEST_SHIPPING_PRICE=0; } if($('shippingservice').value=='') { LOWEST_SHIPPING_PRICE = 0; } $('totalwithfedex').innerHTML = ((subTotal - DCAmount) + new Number(LOWEST_SHIPPING_PRICE) ).toFixed(2) var url=SITE_URL_LAN+'shopping/shipserviceinsessionCart/?srvice='+$('shippingservice').value+'&amount='+LOWEST_SHIPPING_PRICE; new Ajax.Updater( "", url, {asynchronous:true, evalScripts:true, requestHeaders:['X-Update', ""]} ); } function checkShoppinfCartForm(redirectTo) { var totalitems = $('totalitems').value; var itemsRemoved = 0; for(i=1;i<=totalitems;i++) { if ($('removeChk'+i).checked==true) { itemsRemoved++; } } if (itemsRemoved > 0 ) { if ( itemsRemoved == totalitems ) { itemsRemoved = "All"; } jSetButtonLbl("Ok", "Cancel"); jConfirm("Are you sure you want to remove "+itemsRemoved+" items from the Cart?", 'Confirmation', function(r) { if (r == true) { $('redirectTo').value = redirectTo; $('shoppingCart').submit(); } else { jQuery(".checkbox").attr("checked", false); return false; } }); jQuery("#popup_message").first().addClass('cp-dialog'); } else { $('redirectTo').value = redirectTo; $('shoppingCart').submit(); } } function startLoading() { jQuery(".ajaxCallBackLoader").show(); } function stopLoading() { jQuery(".ajaxCallBackLoader").hide(); } function updatewithformobserve(update, url, frmtoObserv) { var a = new Ajax.Updater( update, url, { asynchronous:true, evalScripts:true, parameters:Form.serialize(frmtoObserv), requestHeaders:['X-Update', update], onCreate: startLoading, onComplete: stopLoading } ); } function custome_updater(update, url) { new Ajax.Updater( update, url, { asynchronous:true, evalScripts:true, requestHeaders:['X-Update', update], onSuccess: function(transport) { if(update == '') { alert("Member Type has been updated!"); } } } ); } function showhippingdetails(self, show) { lastItem = false; if(show==true) { lastItem = self; if($('fedexCountry').value == '') { alert("Please Select destination country.") return false; } $('lightBox').style.display=''; if($('fedexCountry').value == 'US') { $('shiptime').innerHTML = usa_shipping_time; } else { $('shiptime').innerHTML = international_shipping_time; } $('lightBox').style.top=(679) +"px"; $('lightBox').style.left=(336) +"px"; if(jQuery( window ).width() <768 || true){ if(typeof $('shipping-method-link') !='undefined'){ try{ $('lightBox').style.left="0.5%"; var pos = jQuery(self).offset(); jQuery('#lightBox').css('top',pos.top+20); }catch(e){ } } } } else { $('lightBox').style.display='none'; } } jQuery(window).resize(function (){ if(jQuery('#lightBox').is(":visible")){ if(typeof lastItem !='undefined' && typeof lastItem !=null && lastItem!=false){ jQuery('#lightBox').css("left","0.5%"); var pos = jQuery(lastItem).offset(); jQuery('#lightBox').css('top',pos.top+20); } } if(jQuery('.lightboxes_div').is(":visible")){ if(typeof lastItem !='undefined' && typeof lastItem !=null && lastItem!=false){ var pos = jQuery(lastItem).offset(); jQuery('#lightBox').css('top',pos.top+20); } } }); function showcheckoutbox(show) { if(show==true) { $('lightBox01').style.display='' $('lightBox01').style.top=(document.body.clientHeight-505) +"px"; } else { $('lightBox01').style.display='none' } } function largeView(crsobj, obj, view, c, man, imgn) { var paras = $A(document.getElementsByClassName('pcNormalBig01')); paras.each(Element.hide); getBrowserInfo(); if(obj!='' && obj != null){refobj=obj}else{obj=refobj} if(c!=0 && c != null){largeViewCounter=c} if(man!='' && man != null){master_asset_number=man} if(imgn!='' && imgn != null){image_number=imgn} if(crsobj!='' && crsobj != null){crossobj=crsobj} var scrld = Number(document.getElementById("t").innerHTML); var offsetLeft=0; var offsetTop=0; var extra_pixels_for_higher_resolutions=0; if(view!='none') { if(browser == "Internet Explorer 7.0" || browser == "Internet Explorer 6.0") { if(window.screen.availWidth>1024){ extra_pixels_for_higher_resolutions=124; } offsetLeft = (obj.offsetParent.offsetLeft + obj.parentNode.offsetLeft)+extra_pixels_for_higher_resolutions + 'px'; offsetTop = (obj.offsetParent.offsetTop + obj.parentNode.offsetTop)+585 - scrld + 'px'; } else { offsetLeft = (obj.offsetLeft )-10 + 'px'; offsetTop = (obj.offsetTop )-(10+scrld ) + 'px'; } crossobj.style.left = offsetLeft; crossobj.style.top = offsetTop; } crossobj.style.display = view; } function scrollTheScroller2() { pollID = setInterval("scrollTheScroller2()",500); } var tm; var flag=0; var mainscrld = 0; function scrollTheScroller(r) { var min1=0; var max1=0; var mod1=29; var mod2=130; var min1=0; var min11=1; var max1=0; var max11=20; document.getElementById("t").innerHTML = document.getElementById("picContainer").scrollTop; var scrld = Number(document.getElementById("t").innerHTML); if (scrld==0){$('count').innerHTML="1-20";return;} if (scrld>0 && scrldparseInt(parseInt(scrld / mod2) * 5 +20)) { if ((scrld % mod1) > 0 && scrld>mod1) { min1=parseInt(parseInt(scrld / mod1) * 5+1 ); max1=parseInt(parseInt(scrld / mod1) * 5+20); min11=parseInt(parseInt(scrld / mod2) * 5+1 ); max11=parseInt(parseInt(scrld / mod2) * 5+25); $('scrolldetails').innerHTML += "
in ---[ SECOND COND ] --- " ; } } else { $('scrolldetails').innerHTML += "
in ---[ ELSE of SECOND COND ] --- " ; if ((scrld % mod1) > 0 && scrld>mod1) { min1=parseInt(parseInt(scrld / mod1) * 5+1 ); min11=parseInt(parseInt(scrld / mod2) * 5 - 4 ); max1=imagePageTotal; max11=imagePageTotal; $('scrolldetails').innerHTML += "
in ---[ ELSE of SECOND COND IN SUB CONDITION ] --- " ; } } if(max11>imagePageTotal) { max11=imagePageTotal; } $('count').innerHTML=min11+'-'+max11; $('scrolldetails').innerHTML += "
Min1 = " + min1 +" = Max1 = " + max1 ; $('scrolldetails').innerHTML += "
Min11 = " + min11 +" = max11 = " + max11 ; update_container(min11, max11, scrld); flag=1; } function update_container(min1, max1, scrld) { var start = 0; if(imagePageTotal0 ) { var url=SITE_URL_LAN+'products/loadimages/?master_asset_number='+master_asset_number+'&start='+start+'&end='+end+'&scrld='+scrld; setTimeout("updatewithformobserve('picContainer2', '" + url + "','dumform')", 1000); } } function update_all_image_container(min1, max1) { var added = 0; flag = 0; for(min1;min1<=max1;min1++) { if ($('image_container_'+min1) != null && $('image_container_new_'+min1) != null) { if($('loader_image_'+min1).alt=='loading') { $('image_container_'+min1).innerHTML = $('image_container_new_'+min1).innerHTML; added++; } } } check_all_loding_images(min1, max1); } function check_all_loding_images(min1, max1) { var scrld = Number(document.getElementById("t").innerHTML); if (scrld>30) { var min1=scrld/30; var max1=min1+50; }else { return false; } if(imagePageTotal"); showError4BT( str ); jQuery('#GuestusersEmail').focus(); scroll(0,0); return false; } } }); return false; } else { return true; } } function shipping_copy() { if($('ship_copy').checked==true) { $('OrderbillingdetailsFname').value=$('OrderbillingdetailsFname1').value; $('OrderbillingdetailsLname').value=$('OrderbillingdetailsLname1').value; $('OrderbillingdetailsCompany').value=$('OrderbillingdetailsCompany1').value; $('OrderbillingdetailsAddress1').value=$('OrderbillingdetailsAddress11').value; $('OrderbillingdetailsAddress2').value=$('OrderbillingdetailsAddress21').value; $('OrderbillingdetailsCity').value=$('OrderbillingdetailsCity1').value; $('OrderbillingdetailsCountry').value=$('OrderbillingdetailsCountry1').value; $('OrderbillingdetailsState').value=$('OrderbillingdetailsState1').value; $('OrderbillingdetailsZip').value=$('OrderbillingdetailsZip1').value; $('OrderbillingdetailsAddressType').value='shipping'; $('OrderbillingdetailsPhoneNo').value=$('OrderbillingdetailsPhoneNo1').value; } else if($('ship_copy').checked==false) { $('OrderbillingdetailsFname').value=''; $('OrderbillingdetailsLname').value=''; $('OrderbillingdetailsCompany').value=''; $('OrderbillingdetailsAddress1').value=''; $('OrderbillingdetailsAddress2').value=''; $('OrderbillingdetailsCity').value=''; $('OrderbillingdetailsCountry').value=''; $('OrderbillingdetailsState').value=''; $('OrderbillingdetailsZip').value=''; $('OrderbillingdetailsAddressType').value='shipping'; $('OrderbillingdetailsPhoneNo').value=''; } } function licensee_copy() { if($('licens_copy').checked==true) { $('OrderbillingdetailsFnameLicensee').value=$('OrderbillingdetailsFname1').value; $('OrderbillingdetailsLnameLicensee').value=$('OrderbillingdetailsLname1').value; $('OrderbillingdetailsCompanyLicensee').value=$('OrderbillingdetailsCompany1').value; $('OrderbillingdetailsAddress1Licensee').value=$('OrderbillingdetailsAddress11').value; $('OrderbillingdetailsAddress2Licensee').value=$('OrderbillingdetailsAddress21').value; $('OrderbillingdetailsCityLicensee').value=$('OrderbillingdetailsCity1').value; $('OrderbillingdetailsCountryLicensee').value=$('OrderbillingdetailsCountry1').value; $('OrderbillingdetailsStateLicensee').value=$('OrderbillingdetailsState1').value; $('OrderbillingdetailsZipLicensee').value=$('OrderbillingdetailsZip1').value; } else if($('licens_copy').checked==false) { $('OrderbillingdetailsFnameLicensee').value=''; $('OrderbillingdetailsLnameLicensee').value=''; $('OrderbillingdetailsCompanyLicensee').value=''; $('OrderbillingdetailsAddress1Licensee').value=''; $('OrderbillingdetailsAddress2Licensee').value=''; $('OrderbillingdetailsCityLicensee').value=''; $('OrderbillingdetailsCountryLicensee').value=''; $('OrderbillingdetailsStateLicensee').value=''; $('OrderbillingdetailsZipLicensee').value=''; } } function countit(keycode) { var wordLimit = 500; var formcontent=document.getElementById('TellMessage').value; var count=formcontent.length; if(count >499) { alert('You cannot write more then '+wordLimit+' characters!') document.getElementById('TellMessage').value=(formcontent.substr(0,499)) } document.getElementById('totalChar').value=count; return true; } function charcount(keycode) { var wordLimit = 2500; var formcontent=document.getElementById('ContactMessage').value; var count=formcontent.length; if(count >2499) { alert('Please limit your message to '+wordLimit+' characters.') document.getElementById('ContactMessage').value=(formcontent.substr(0,2499)) } return true; } function charcount2(keycode) { var wordLimit = 500; var formcontent=document.getElementById('UserAboutme').value; var count=formcontent.length; if(count >499) { alert('You cannot write more then '+wordLimit+' characters!') document.getElementById('UserAboutme').value=(formcontent.substr(0,499)) } return true; } function charcount3(keycode) { var wordLimit = 50; var formcontent=document.getElementById('UserCity').value; var count=formcontent.length; if(count >49) { alert('You cannot write more then '+wordLimit+' characters!') document.getElementById('UserCity').value=(formcontent.substr(0,499)) } return true; } function charcount4(keycode) { var wordLimit = 50; var formcontent=document.getElementById('UserCountry').value; var count=formcontent.length; if(count >49) { alert('You cannot write more then '+wordLimit+' characters!') document.getElementById('UserCountry').value=(formcontent.substr(0,499)) } return true; } function charcount5(keycode) { var wordLimit = 50; var formcontent=document.getElementById('UserForumemail').value; var count=formcontent.length; if(count >49) { alert('You cannot write more then '+wordLimit+' characters!') document.getElementById('UserForumemail').value=(formcontent.substr(0,499)) } return true; } function charcountDynamic(elmnt, wl) { var wordLimit = wl; var formcontent=$(elmnt).value; var count=formcontent.length; if(count >wl) { alert('You cannot write more then '+wordLimit+' characters!') $(elmnt).value=(formcontent.substr(0,wl)) } return true; } function max_chars_limit(e, limit, ctrl) { if(window.event) { keynum = e.keyCode; } else if(e.which) { keynum = e.which; } if(keynum == 8 || keynum == 13 || keynum == 27 || keynum == 33 || keynum == 34 || keynum == 35 || keynum == 37 || keynum == 38 || keynum == 39 || keynum == 40 || keynum == 45 || keynum == 46 || keynum == 116 || keynum == 16 || keynum == 17 || keynum == 18 ) { return String.fromCharCode(keynum); } var wordLimit = limit; var formcontent=document.getElementById(ctrl).value; var count=formcontent.length; if(count >limit-1) { alert('You cannot write more then '+wordLimit+' characters!') document.getElementById(ctrl).value=(formcontent.substr(0,limit-1)) return false; } return true; } function dimessage(n) { url = SITE_URL+'admin/download_instruction/' + n; jSetButtonLbl("Ok", "Cancel"); jConfirm("Are you sure you want to send 'Download Instruction' email?", 'Confirmation', function(r) { if (r == true) { open_window2(url, 900, 200, 'center'); } else { return false; } }); } function open_window(url,w,h) { var testwindow=window.open (url, "mywindow", "toolbar=1,menubar=1,location=1,status=1,scrollbars=1,width="+w+",height="+h+""); try { testwindow.focus(); testwindow.moveTo(window.screen.availWidth-w,window.screen.availHeight-h); }catch(e){ } } function open_window2(url,w,h, position) { var testwindow= window.open (url, "mywindow", "resizable=1, toolbar=1,menubar=1,location=1,status=1,scrollbars=1,width="+w+",height="+h+""); if(position=='rightbottom' || position=='bottomright') { testwindow.moveTo(window.screen.availWidth-w,window.screen.availHeight-h); } else if(position=='center') { try { testwindow.moveTo(window.screen.availWidth/2-w/2,window.screen.availHeight/2-h/2); }catch(e){ } } testwindow.focus(); } function open_window22(url,w,h, position) { var testwindow= window.open (url, "mywindow", "width=800,height=600,toolbar=1,scrollbars=1,location=0,statusbar=1,menubar=0,resizable=1"); if(position=='rightbottom' || position=='bottomright') { testwindow.moveTo(window.screen.availWidth-w,window.screen.availHeight-h); } else if(position=='center') { try { testwindow.moveTo(window.screen.availWidth/2-w/2,window.screen.availHeight/2-h/2); }catch(e){ } } } function checkPhotoBuyForm(frm) { var ttl = 0; var total_photo_product_chk = $('total_photo_product_chk').value; for(i = 1;i <= total_photo_product_chk; i++) { if($('photo_product_chk_'+i) != null && $('photo_product_chk_'+i).checked == true ) { ttl++; } } if(ttl <= 0) { alert('Please select a product before you click NEXT.') return false; } else { return true; } } /* treat_search */ function handleSearchQfor500Error() { var searchQ = document.getElementById('q').value + ''; searchQ = treat_text(searchQ, 'treatsql'); document.getElementById('q').value = searchQ; } function birth_day_history(frm) { handleSearchQfor500Error(); if (birth_day_history_search != 1) { frm.action = frm.action.replace("month","mn1") frm.action = frm.action.replace("day","dy1") try { $('day').value = ""; $('month').value = ""; } catch (e) { } } } /*******SEARCH VALIDATION********/ function searchterm(t) { if(document.getElementById('q').value=="Search over 583 videos and 81 thousand images." || document.getElementById('q').value=="") { alert("Please enter search term(s)"); document.getElementById('q').focus(); return false; } else { return true; } } function showhide(url) { if(document.getElementById('zemanta').style.display=='none') { document.getElementById('zemanta').style.display='block'; document.getElementById('more').innerHTML="
  •   Less
  • "; } else if(document.getElementById('zemanta').style.display=='block') { document.getElementById('zemanta').style.display='none'; document.getElementById('more').innerHTML="
  •   More
  • "; } } function showhidelink(url) { if(document.getElementById('zemantalink').style.display=='none') { document.getElementById('zemantalink').style.display='block'; document.getElementById('morelink').innerHTML="
  •   Less
  • "; } else if(document.getElementById('zemantalink').style.display=='block') { document.getElementById('zemantalink').style.display='none'; document.getElementById('morelink').innerHTML="
  •   More
  • "; } } function showhideElement(ctrl, obj) { if($(ctrl).style.display=="") { $(ctrl).style.display = "none"; } else { $(ctrl).style.display = ""; } if(obj != null) { $(ctrl).style.top = parseInt(obj.offsetTop) + 200 + "px"; if(jQuery(obj).width() <768){ $(ctrl).style.left = "0.5%"; } } } function keyPressed(obj, e) { if(e.keycode==46 || e.keycode==8) { obj.value=''; } } function checkDates(biggerObj, smallerObj) { if(document.search.dateRange.checked==true) { bigd=$(biggerObj).value; smalld=$(smallerObj).value; if(isDate(bigd) && isDate(smalld)) { if(bigd=='' || smalld=='') return true; bigd=bigd.split('-') smalld=smalld.split('-') var bigDate=new Date(); var smallDate=new Date(); bigDate.setFullYear(bigd[0],bigd[1],bigd[2]); smallDate.setFullYear(smalld[0],smalld[1],smalld[2]); var today = new Date(); if (smallDate>=bigDate) { }else { alert("End date must be greater tha Start date"); return false; } return true; } else { return false; } } } function isInteger(s) { var i; for (i = 0; i < s.length; i++){ var c = s.charAt(i); if (((c < "0") || (c > "9"))) return false; } return true; } function stripCharsInBag(s, bag) { var i; var returnString = ""; for (i = 0; i < s.length; i++){ var c = s.charAt(i); if (bag.indexOf(c) == -1) returnString += c; } return returnString; } function daysInFebruary (year) { return (((year % 4 == 0) && ( (!(year % 100 == 0)) || (year % 400 == 0))) ? 29 : 28 ); } function DaysArray(n) { for (var i = 1; i <= n; i++) { this[i] = 31 if (i==4 || i==6 || i==9 || i==11) {this[i] = 30} if (i==2) {this[i] = 29} } return this; } var dtCh= "-"; function isDate(dtStr) { var daysInMonth = DaysArray(12) var pos1=dtStr.indexOf(dtCh) var pos2=dtStr.indexOf(dtCh,pos1+1) var strYear=dtStr.substring(0,pos1) var strMonth=dtStr.substring(pos1+1,pos2) var strDay=dtStr.substring(pos2+1) strYr=strYear if (strDay.charAt(0)=="0" && strDay.length>1) strDay=strDay.substring(1) if (strMonth.charAt(0)=="0" && strMonth.length>1) strMonth=strMonth.substring(1) for (var i = 1; i <= 3; i++) { if (strYr.charAt(0)=="0" && strYr.length>1) strYr=strYr.substring(1) } month=parseInt(strMonth) day=parseInt(strDay) year=parseInt(strYr) if (pos1==-1 || pos2==-1){ alert("The date format should be : yyyy-mm-dd") return false; } if (strMonth.length<1 || month<1 || month>12){ alert("Please enter a valid month") return false; } if (strDay.length<1 || day<1 || day>31 || (month==2 && day>daysInFebruary(year)) || day > daysInMonth[month]){ alert("Please enter a valid day") return false; } if (strYear.length != 4 || year==0 ){ alert("Please enter a valid 4 digit year"); return false; } if (dtStr.indexOf(dtCh,pos2+1)!=-1 || isInteger(stripCharsInBag(dtStr, dtCh))==false){ alert("Please enter a valid date") return false; } return true; } function checkme(id,no) { if(no=='plus') id=parseInt(id)+1; if(no=='minus') id=parseInt(id)-1; if(document.getElementById('photo_product_chk_'+id)!=null) { if(document.getElementById('photo_product_chk_'+id).checked) { document.getElementById('photo_product_chk_'+id).checked=false; } } } function uncheck_compete(id,no){ if(no == 'pro') id2 = parseInt(id)+1; if(no == 'personal') id2 = parseInt(id)-1; if(document.getElementById('photo_product_chk_'+id) != null && document.getElementById('photo_product_chk_'+id2) != null) { if(document.getElementById('photo_product_chk_'+id).checked == true) document.getElementById('photo_product_chk_'+id2).checked = false; } } function getFlashMovie(movieName) { var isIE = navigator.appName.indexOf("Microsoft") != -1; return (isIE) ? window[movieName] : document[movieName]; } function pauseVideo() { try { if(jwplayer('player3_1').getState() == 'PLAYING') { jwplayer('player3_1').pause(); } }catch (e){} var fplayer = getFlashMovie("flaMovie"); if (fplayer != 'undefined' && fplayer!= null ) { try { fplayer.pausePlayer(); } catch (e) { } } } function playVideo() { try { if(jwplayer('player3_1').getState() == 'PAUSED') { jwplayer('player3_1').play(); } }catch (e){} var fplayer = getFlashMovie("flaMovie"); if (fplayer != 'undefined' && fplayer!= null ) { try { fplayer.playPlayer(); } catch (e) { } } } function call() { $('proText').innerHTML=$('professionalOptions').style.display=='none'?'Click on the "+" button to see Professional Options':'Click on the "-" button to close Professional Options'; } function checkcomment1(id,edit) { if(FCKeditorAPI.GetInstance('comment'+id).GetXHTML()=="") { alert("Please Enter Message"); return false; } else { if(edit==0) url=SITE_URL_LAN+'forums/postcommentsave/0/'+id+'/null/'+base64_encode(FCKeditorAPI.GetInstance('comment'+id).GetXHTML()); else url=SITE_URL_LAN+'forums/postcommentsave/0/'+id+'/'+edit+'/'+base64_encode(FCKeditorAPI.GetInstance('comment'+id).GetXHTML()); custome_updater('test_'+id, url) return false; } } function base64_encode (data) { var b64 = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/="; var o1, o2, o3, h1, h2, h3, h4, bits, i = 0, ac = 0, enc="", tmp_arr = []; if (!data) { return data; } data = this.utf8_encode(data+''); do { o1 = data.charCodeAt(i++); o2 = data.charCodeAt(i++); o3 = data.charCodeAt(i++); bits = o1<<16 | o2<<8 | o3; h1 = bits>>18 & 0x3f; h2 = bits>>12 & 0x3f; h3 = bits>>6 & 0x3f; h4 = bits & 0x3f; tmp_arr[ac++] = b64.charAt(h1) + b64.charAt(h2) + b64.charAt(h3) + b64.charAt(h4); } while (i < data.length); enc = tmp_arr.join(''); switch (data.length % 3) { case 1: enc = enc.slice(0, -2) + '=='; break; case 2: enc = enc.slice(0, -1) + '='; break; } return enc; } function utf8_encode ( argString ) { var string = (argString+'').replace(/\r\n/g, "\n").replace(/\r/g, "\n"); var utftext = ""; var start, end; var stringl = 0; start = end = 0; stringl = string.length; for (var n = 0; n < stringl; n++) { var c1 = string.charCodeAt(n); var enc = null; if (c1 < 128) { end++; } else if (c1 > 127 && c1 < 2048) { enc = String.fromCharCode((c1 >> 6) | 192) + String.fromCharCode((c1 & 63) | 128); } else { enc = String.fromCharCode((c1 >> 12) | 224) + String.fromCharCode(((c1 >> 6) & 63) | 128) + String.fromCharCode((c1 & 63) | 128); } if (enc !== null) { if (end > start) { utftext += string.substring(start, end); } utftext += enc; start = end = n+1; } } if (end > start) { utftext += string.substring(start, string.length); } return utftext; } function catchevent(event,formname) { if(event.keyCode==13) { submitForm(formname); } } function lightIE8(event,formname, action) { place = detect.indexOf('msie') if(place>=0) { if(event.keyCode==13) { new Ajax.Updater('login',SITE_URL_LAN+'user/'+action, {asynchronous:true, evalScripts:true, parameters:Form.serialize(Event.element(event).form), requestHeaders:['X-Update', 'login']}); } } } function onmiceout(ths) { if($(ths).title!='1'){ $(ths).className = 'miceOut'; } return true; } function onmicemove(ths) { var dmarr = $$('miceMove') var cntr=0; for(i=0;i1)) { $(dmarr[i]).className = 'miceOut'; }else{cntr++;} } $(ths).className = 'miceMove'; return true; } function onmiceclick(ths) { var dmarr = $$('div[title="1"]') for(i=0;i=0) { $('temp').value = 1; }else{ $('temp').value = 0; } } function stpxession(sessionvar, sessionval) { setunsetphpsession(sessionvar, sessionval); } function setunsetphpsession(sessionvar, sessionval) { var args = ""; var f = "setunsetsession"; args += sessionvar+"|"; args += sessionval+"|"; args=Base64.encode(args); f = Base64.encode(f); var str = f+"__"+args; url = SITE_URL_LAN+'shopping/wrapperF/'+str; url = SITE_URL_LAN+'shopping/wrapperF/'+str; new Ajax.Updater( "", url, {asynchronous:true, evalScripts:true, requestHeaders:['X-Update', ""]} ); } function _body_onload() { setScrollInIE(); turnAutocompleteOff(); loff(); var std_context = 'login_up'; SetHelpPrefix(''); SetContext(std_context, ''); try { if (top && top.leftFrame) { SetExpandLeftFrame(); } } catch (e) { } } function _body_resize() { setScrollInIE(); lresize(); } function _body_onunload() { lon(); } function preloader() { str='

    loading...Please wait Loading...

    '; return str; } function updateuspsfree() { $('uspsfree').innerHTML="test"; } var opt_no_frames = false; var opt_integrated_mode = false; var videoplay=false; function hello(val) { videoplay=val; } function setText(ctrl, str) { if((typeof( ctrl ) == "string" ) ) { var obj = $(ctrl); } else { var obj = ctrl; } try{ if (obj.value == str) { obj.value = ""; } } catch(e){} } function removeText(ctrl, str) { if((typeof( ctrl ) == "string" ) ) { var obj = $(ctrl); } else { var obj = ctrl; } if (obj.value == "") { obj.value = str; } } function submitForm1(frm) { if((typeof( frm ) == "string" ) ) { frm = $(frm); } else { frm = frm; } frm.submit(); } function loadAmazonCloud() { var args=""; var f="loadAmazonCloud"; args+="0|0|0|"; args=Base64.encode(args); f=Base64.encode(f); var str=f+"__"+args; url=SITE_URL_LAN+'products/wrapperF/'+str; custome_updater("amazon", url); } function OnUrlChange2(elmnt) { var oRegex = new Object() ; oRegex.UriProtocol = /^(((http|https|ftp|news):\/\/)|mailto:)/gi ; oRegex.UrlOnChangeProtocol = /^(http|https|ftp|news):\/\/(?=.)/gi ; oRegex.UrlOnChangeTestOther = /^((javascript:)|[#\/\.])/gi ; oRegex.ReserveTarget = /^_(blank|self|top|parent)$/i ; oRegex.PopupUri = /^javascript:void\(\s*window.open\(\s*'([^']+)'\s*,\s*(?:'([^']*)'|null)\s*,\s*'([^']*)'\s*\)\s*\)\s*$/ ; oRegex.OnClickPopup = /^\s*on[cC]lick="\s*window.open\(\s*this\.href\s*,\s*(?:'([^']*)'|null)\s*,\s*'([^']*)'\s*\)\s*;\s*return\s*false;*\s*"$/ ; oRegex.PopupFeatures = /(?:^|,)([^=]+)=(\d+|yes|no)/gi ; var sUrl = $(elmnt).value ; var sProtocol = oRegex.UrlOnChangeProtocol.exec( sUrl ) ; if ( sProtocol ) { sUrl = sUrl.substr( sProtocol[0].length ) ; $(elmnt).value = sUrl ; } } function submitCCListForm(vl) { if(vl.value == -11 ) { window.location.href = SITE_URL_LAN + "user/add_cc"; } else if(vl.value == 0 ) { window.location.href = SITE_URL_LAN + "user/ccinfo"; } else { window.location.href = SITE_URL_LAN + "user/edit_cc/" + vl.value; } }; /** JQUERY CODE**/ if(jQuery != null) { var total_images_in_current_lightbox = 0; var total_videos_in_current_lightbox = 0; var notification_timeout = null; var track_notes_changes = 0; var hover_delay = 1000; var cTimer = 0; /* Timer variable to control the Hover Delay of left floating menu "Menu1"*/ var cShowOverlay = 0; /* Variable to control visibility of the Popup division */ var tmpObj = null; /* Temporary object to represent the current Hoverd Anchor element of the left floating menu "Menu1"*/ jQuery(document).ready(function($) { jQuery(".language_selector").mouseenter(function(e) { e.stopPropagation(); e.preventDefault(); jQuery(this).find(".language_options").show(); }); jQuery(".language_selector").mouseleave(function(e) { e.stopPropagation(); e.preventDefault(); jQuery(this).find(".language_options").hide(); }); jQuery('body').append('
    '); jQuery('body').append('
    '); jQuery('body').append('
    '); open_add_to_lightbox(); check_all_checkboxes_bindings(); lightbox_addtocart_bindings(); track_notes_changes_bindings(); jToolTip(); magnify_jq_bindings(); jQuery(".btnCancel").click(function($) { jQuery(".lightboxes_div").slideUp(200); }); jQuery(".lblSelAll").click(function($) { if(jQuery(this).parent().find(".checkbox_main").prop('checked') == true) { jQuery(".checkbox_child").prop("checked", false); jQuery(".checkbox_main").prop("checked", false); jQuery(".checkbox_child").attr("checked", false); jQuery(".checkbox_main").attr("checked", false); } else { jQuery(".checkbox_child").prop("checked", true); jQuery(".checkbox_main").prop("checked", true); jQuery(".checkbox_child").attr("checked", true); jQuery(".checkbox_main").attr("checked", true); } }); }); var keep_magnify = 0; function magnify_jq_bindings() { jQuery(".magnify_jq").unbind(); jQuery(".magnify_jq").hover(function() { var i=0; for(i=1;i<=imagePageTotal;i++) { if(jQuery('#largeImage'+i) == null ) return; jQuery('#largeImage'+i).hide(); } keep_magnify = 1; var rel = jQuery(this).attr("rel"); var obj = this; jQuery(rel).css("top",parseInt(jQuery(obj).offset().top - 10 ) + "px"); jQuery(rel).css("left",parseInt(jQuery(obj).offset().left - 10 ) + "px"); jQuery(rel).show(); }, function() { var rel = jQuery(this).attr("rel"); console.log("keep_magnify = " + keep_magnify) jQuery(rel).hide(); }); jQuery(".magnify_child_jq").hover(function() { jQuery(this).show(); }, function() { jQuery(this).hide(); }); jQuery(".magnify_button_jq").hover(function() { var rel = jQuery(this).closest(".magnify_child_jq"); }); } function track_notes_changes_bindings() { jQuery(".tAreaLong").unbind(); jQuery(this).each(function($){ jQuery(this).change(function($){ track_notes_changes = 1; }); }); } function lightbox_addtocart_bindings() { jQuery(".lightbox_addtocart").unbind(); jQuery(".lightbox_addtocart").each(function($){ jQuery(this).click(function($){ total_videos_in_current_lightbox = 0; total_images_in_current_lightbox = 0; var total_checked_items = 0; var video_item_ids = ""; var image_item_ids = ""; var videotype = jQuery(this).attr("videotype"); jQuery(".checkbox_child").each(function($) { if(jQuery(this).prop('checked') == true || jQuery(this).attr("checked") == 'checked') { if(jQuery("#item_type_" + jQuery(this).attr("value")).val() == 'video' ) { total_videos_in_current_lightbox++; if(jQuery.trim(video_item_ids) != "" ) video_item_ids = video_item_ids + ","; video_item_ids += jQuery(this).attr("value"); } else { total_images_in_current_lightbox++; if(jQuery.trim(image_item_ids) != "" ) image_item_ids = image_item_ids + "," ; image_item_ids += jQuery(this).attr("value"); } total_checked_items++; } }); video_item_ids = Base64.encode(video_item_ids); image_item_ids = Base64.encode(image_item_ids); item_types = ''; var mthd = ''; if(total_images_in_current_lightbox > 0 && total_videos_in_current_lightbox > 0) { item_types = 'both'; mthd = 'videobuydetails_new'; } if(total_images_in_current_lightbox <= 0 && total_videos_in_current_lightbox > 0) { item_types = 'videos'; mthd = 'videobuydetails_new'; } if(total_images_in_current_lightbox > 0 && total_videos_in_current_lightbox <= 0) { item_types = 'images'; mthd = 'photobuydetails_new'; } if(total_checked_items > 0) { if(mthd != '') { url = SITE_URL_LAN + "products/"+mthd+"/?videotype=" + videotype + "&item_type=" + item_types + "&video_items=" + video_item_ids + "&image_items=" + image_item_ids; Modalbox.show(url, {title: "", width: 770}); return false; } } else { alert("Please select item(s) first using checkboxes at left."); } return false; }); }); return false; } function load_saved_lightboxes_for_lightbox(obj) { var total_checked_items = 0; var item_ids = ""; jQuery(".checkbox_child").each(function($){ if(jQuery(this).prop('checked') == true) { if(jQuery.trim(item_ids) != "" ) item_ids = item_ids + "," ; total_checked_items++; item_ids += jQuery(this).attr("value"); } }); item_ids = Base64.encode(item_ids); if(total_checked_items >0 ) { var current_view_lightbox_id = parseInt(jQuery("#curr_lightbox_view_id").val()); jQuery.ajax( { url: SITE_URL_LAN + "lightbox/small_addto_lightbox?multiple_items=" + item_ids + "¤t_view_lightbox_id="+current_view_lightbox_id, success: function(response) { jQuery('.lightboxes_div').html(response); jQuery(".lightboxes_div").css("top",parseInt(jQuery(obj).offset().top - jQuery(obj).height() - 210) + "px"); jQuery(".lightboxes_div").css("left",parseInt(jQuery(obj).offset().left + jQuery(obj).width() - 175 ) + "px"); jQuery('.lightboxes_div').show(); isBoxSet = 0; lastItem = obj; small_create_new_lightbox_bindings(); } }); } else { alert("Please select item(s) first using checkboxes at left."); } return false; } function get_any_fade_message(gUrl) { if(typeof(gUrl) == 'undefined') { gUrl = SITE_URL_LAN + "lightbox/get_any_fade_message"; } jQuery.ajax( { url: gUrl, cache:false, success: function(response) { eval('data = ' + response); if(jQuery.trim(data.msg) != "") { keep_show_notification( data.msg ); } } }); } function submit_lightbox_form(act) { var total_items = 0; var total_checked_items = 0; jQuery(".checkbox_child").each(function($){ total_items++; if(jQuery(this).prop('checked') == true) { total_checked_items++; } }); if(total_checked_items <= 0 && act != 'savenotes') { alert("Please select item(s) first using checkboxes at left."); return false; } if(act == 'delete') { var del_items = total_checked_items; var user_msg_some_items = "Are you sure you want to remove "+del_items+" items from the lightbox?"; var user_msg_all_items = "Are you sure you want to remove all items from the lightbox?"; var user_msg_display = user_msg_some_items; if(total_items == total_checked_items){ del_items = 'all'; user_msg_display = user_msg_all_items; } jSetButtonLbl("Ok", "Cancel"); jConfirm(user_msg_display, 'Confirmation', function(r) { if (r == true) { if(act == 'savenotes') { window.onbeforeunload = null; } treat_lb_notes(); jQuery(".lightbox_submit_action").val(act); jQuery('#lightbox').submit(); } else { return false; } }); } else { if(act == 'savenotes') { window.onbeforeunload = null; } treat_lb_notes(); jQuery(".lightbox_submit_action").val(act); jQuery('#lightbox').submit(); } } function treat_lb_notes() { jQuery('textarea').each(function() { var alteredText = jQuery(this).val(); alteredText = treat_text(alteredText, 'untreatsql'); alteredText = treat_text(alteredText, 'treatsql'); jQuery(this).val(alteredText); }); } function submit_guestlightbox_form(act) { var total_items = 0; var total_checked_items = 0; jQuery(".checkbox_child").each(function($){ total_items++; if(jQuery(this).prop('checked') == true) { total_checked_items++; } }); if(total_checked_items <= 0 ) { alert("Please select item(s) first using checkboxes at left."); return false; } if(act == 'delete') { var del_items = total_checked_items; var user_msg_some_items = "Are you sure you want to remove "+del_items+" items from the lightbox?"; var user_msg_all_items = "Are you sure you want to remove all items from the lightbox?"; var user_msg_display = user_msg_some_items; if(total_items == total_checked_items){ del_items = 'all'; user_msg_display = user_msg_all_items; } jSetButtonLbl("Ok", "Cancel"); jConfirm(user_msg_display, 'Confirmation', function(r) { if (r == true) { jQuery(".lightbox_submit_action").val(act); jQuery('#lightbox').submit(); } else { return false; } }); } else { jQuery(".lightbox_submit_action").val(act); jQuery('#lightbox').submit(); } } function load_saved_lightboxes(obj, rel) { jQuery("#loader0").css("top",parseInt(jQuery(obj).offset().top - jQuery(obj).height() - 125 ) + "px"); jQuery("#loader0").show(); eval(rel); var item_type = options.item_type; var master_asset_number= options.master_asset_number; var audience = options.audience; if(item_type == 'image') { var image_number = options.image_number; } else { var image_number = 0; audience = 'KP'; } if(item_type != 'image' && item_type != 'video') { return false; } isBoxSet = 0; jQuery.ajax( { url: SITE_URL_LAN + "lightbox/small_addto_lightbox?item_type=" + item_type + "&image_number=" + image_number + "&master_asset_number=" + master_asset_number+ "&audience=" + audience, success: function(response) { jQuery("#loader0").hide(); jQuery('.lightboxes_div').html(response); jQuery(".lightboxes_div").css("width",'275px'); if(audience == 'KP' || language_code != 'en' ) { jQuery(".adSeprator").css("width",'256px'); } else { } jQuery(".lightboxes_div").css("top",parseInt(jQuery(obj).offset().top - jQuery(obj).height() - 125 ) + "px"); jQuery(".lightboxes_div").css("left",parseInt(jQuery(obj).offset().left + jQuery(obj).width() - 150 ) + "px"); jQuery('.lightboxes_div').show(); small_create_new_lightbox_bindings(); } }); return false; } function seeMoreMoueIn(tmpObj) { cTimer = setTimeout(c, hover_delay); cShowOverlay = 1; function c() { if(cShowOverlay == 1) { console.log("jToolTip_js hover in"); clearTimeout(jQuery('.jToolTipDiv').data('timer')); var rel = jQuery(tmpObj).attr("rel"); jQuery('.jToolTipDiv').html(jQuery(rel).html()); jToolTipDivTop = jQuery(tmpObj).offset().top - (jQuery('.jToolTipDiv').height()/2) + 150; jQuery(".jToolTipDiv").css("top", jToolTipDivTop + "px"); //jQuery(".jToolTipDiv").css("left",parseInt(jQuery(tmpObj).offset().left - (jQuery(rel).width() / 2)-info_offset ) + "px"); jQuery(".jToolTipDiv").css("left",parseInt(jQuery(tmpObj).offset().left - (jQuery(rel).width() / 2)+50 ) + "px"); jQuery('.jToolTipDiv').css('width','950px'); jQuery("#xjToolTipDivx").center(); jQuery('.jToolTipDiv').show(); jToolTipDiv_T = jQuery(".jToolTipDiv").offset().top; jToolTipDiv_H = parseInt(jQuery(".jToolTipDiv").css("height")); jToolTipDivT_H = jToolTipDiv_T + jToolTipDiv_H; window_Height = jQuery(window.top).height(); window_Scroll = jQuery(window).scrollTop(); jToolTipDivTop = (window_Height + window_Scroll) - ((window_Height/2)+(jToolTipDiv_H/2) ) jQuery(".jToolTipDiv").css("top", jToolTipDivTop + "px"); bindHideTip(); } } } function seeMoreMoueOut() { clearTimeout(cTimer); jQuery('.jToolTipDiv').data('timer', setTimeout(function() { cShowOverlay = 0; console.log("jToolTip_js hover out"); jQuery('.jToolTipDiv').hide(); }, 1000) ); } function jToolTip() { jQuery('.jToolTip_js').each(function(){ jQuery(this).click(function() { console.log(".jToolTip_js click..."); seeMoreMoueIn(this); }); jQuery(this).hover(function() { console.log(".jToolTip_js hover..."); seeMoreMoueIn(this); },function(){ seeMoreMoueOut(this); }); try { jQuery(this).touchstart(function() { cTimer = setTimeout(c, hover_delay); cShowOverlay = 1; tmpObj = this; function c() { if(cShowOverlay == 1) { var rel = jQuery(tmpObj).attr("rel"); jQuery('.jToolTipDiv').html(jQuery(rel).html()); jQuery(".jToolTipDiv").css("top",parseInt(jQuery(tmpObj).offset().top - (jQuery('.jToolTipDiv').height()/2) ) + 150 + "px"); jQuery(".jToolTipDiv").css("left",parseInt(jQuery(tmpObj).offset().left - (jQuery(rel).width() / 2) ) + "px"); jQuery('.jToolTipDiv').show(); bindHideTip(); } } },function(){ cShowOverlay = 0; jQuery('.jToolTipDiv').hide(); }); }catch(e){ } }); jQuery('.jToolTipDiv').each(function(){ jQuery(this).hover(function(){ console.log(".jToolTipDiv hover..."); clearTimeout(jQuery('.jToolTipDiv').data('timer')); jQuery('.jToolTipDiv').show(); },function(){ jQuery('.jToolTipDiv').hide(); }); }); } function load_guest_lightboxes(obj, rel) { jQuery('#loader0').show(); eval(rel); var item_type = options.item_type; var master_asset_number= options.master_asset_number; var audience = options.audience; if(item_type == 'image') { var image_number = options.image_number; } else { var image_number = 0; } if(item_type != 'image' && item_type != 'video') { return false; } jQuery.ajax( { url: SITE_URL_LAN + "lightbox/addto_guestlightbox?item_type=" + item_type + "&image_number=" + image_number + "&master_asset_number=" + master_asset_number+ "&audience=" + audience, success: function(response) { jQuery('#loader0').hide(); show_notification(response); } }); return false; } /** added by nikita **/ function load_guest_lightboxes_new(obj, rel) { jQuery('#loader0').show(); eval(rel); var item_type = options.item_type; var master_asset_number= options.master_asset_number; var audience = options.audience; if(item_type == 'image') { var image_number = options.image_number; } else { var image_number = 0; } if(item_type != 'image' && item_type != 'video') { return false; } jQuery.ajax( { url: SITE_URL_LAN + "lightbox/small_addto_lightbox_guest?item_type=" + item_type + "&image_number=" + image_number + "&master_asset_number=" + master_asset_number+ "&audience=" + audience, success: function(response) { jQuery("#loader0").hide(); jQuery('.lightboxes_div').html(response); jQuery(".lightboxes_div").css("top",parseInt(jQuery(obj).offset().top - jQuery(obj).height() - 125 ) + "px"); jQuery(".lightboxes_div").css("left",parseInt(jQuery(obj).offset().left + jQuery(obj).width() - 150 ) + "px"); jQuery('.lightboxes_div').show(); } }); return false; } /** function guestlight box ends here **/ /** function to add to lightbox for guest users**/ function guest_users_lightbox() { jQuery(".add_to_guestlightbox_inner").unbind(); jQuery(".add_to_guestlightbox_inner").each(function($){ jQuery(this).click(function($){ load_guest_lightboxes(this, jQuery(this).attr("rel")) return false; }); }); } function open_add_to_lightbox() { jQuery(".add_to_lightbox").unbind(); jQuery(".add_to_lightbox").each(function($){ isBoxSet = 0; jQuery(this).click(function($){ load_saved_lightboxes(this, jQuery(this).attr("rel")) return false; }); }); jQuery(".add_to_guestlightbox").unbind(); jQuery(".add_to_guestlightbox").each(function($){ jQuery(this).click(function($){ var relattr = jQuery(this).attr("rel"); eval(jQuery(this).attr("rel")); var audience = options.audience; var imageType = options.item_type; if(audience == 'OK' && imageType == 'image') { load_guest_lightboxes(this, relattr) } else { load_guest_lightboxes(this, relattr) } return false; }); }); jQuery(".add_to_different_lightbox").unbind(); jQuery(".add_to_different_lightbox").each(function($){ jQuery(this).click(function($){ load_saved_lightboxes_for_lightbox(this) return false; }); }); return false; } var isBoxSet = 1; function small_create_new_lightbox_bindings() { /* jQuery(".small_create_new_lightbox").toggle(function(){ jQuery(this).parent().addClass("upCNLB"); jQuery(".saved_lightbox_form_buttons").hide(); jQuery(jQuery(this).attr("rel")).slideDown(200,function(){jQuery("#lightboxesName").focus()}); jQuery(".small_create_new_lightbox").html('Create new Lightbox'); },function(){ jQuery(".saved_lightbox_form_buttons").show(); jQuery(this).parent().removeClass("upCNLB"); jQuery(jQuery(this).attr("rel")).slideUp(200); jQuery(".small_create_new_lightbox").html('Create new Lightbox'); }); */ if(isBoxSet == 0){ jQuery(".small_create_new_lightbox").unbind(); jQuery(".small_create_new_lightbox").click(function (){ if(jQuery(".small_create_new_lightbox_div").css("display") == "none"){ jQuery(this).parent().addClass("upCNLB"); jQuery(".saved_lightbox_form_buttons").hide(); jQuery(jQuery(this).attr("rel")).slideDown(200,function(){jQuery("#lightboxesName").focus()}); jQuery(".small_create_new_lightbox").html('Create new Lightbox'); }else{ jQuery(".saved_lightbox_form_buttons").show(); jQuery(this).parent().removeClass("upCNLB"); jQuery(jQuery(this).attr("rel")).slideUp(200); jQuery(".small_create_new_lightbox").html('Create new Lightbox'); } }); isBoxSet = 1; } return false; } function check_all_checkboxes_bindings() { jQuery("input.checkbox_main").click(function() { if(jQuery(this).prop('checked') == true) { jQuery(".checkbox_child").prop("checked",true); jQuery(".checkbox_child").attr("checked",true); } else { jQuery(".checkbox_child").prop("checked",false); jQuery(".checkbox_child").attr("checked",false); } }); jQuery(".checkbox_child").each(function($) { jQuery(this).click(function($) { if(jQuery(this).is(':checked')) { jQuery(this).attr("checked",true); } else { jQuery(this).attr("checked",false); } }); }); } function show_notification(message) { var left = parseInt( (jQuery(window).width() / 2) - (jQuery(".lightboxes_notifications").width() / 2) ); jQuery(".lightboxes_notifications").css("left",parseInt( left ) + "px"); clearTimeout(notification_timeout); jQuery(".lightboxes_notifications").find(".notification_detail").html(message); jQuery(".lightboxes_notifications").fadeIn('slow'); notification_timeout = setTimeout(hide_notification, 4000); jQuery(".lightboxes_div").hide(); } function keep_show_notification(message) { var left = parseInt( (jQuery(window).width() / 2) - (jQuery(".lightboxes_notifications").width() / 2) ); jQuery(".lightboxes_notifications").css("left",parseInt( left ) + "px"); clearTimeout(notification_timeout); jQuery(".lightboxes_notifications").find(".notification_detail").html(message); jQuery(".lightboxes_notifications").fadeIn('slow'); notification_timeout = setTimeout(hide_notification, 4000); } function hide_notification() { jQuery(".lightboxes_notifications").fadeOut('slow'); } function make_api_call(params, callback_mehtod) { var param_str = ""; for (var i = 2; i < arguments.length; ++i) { param_str += ", '"+ arguments[i]+"' "; } var url = params.url; jQuery.ajax({ url: url, type: "POST", data: params.data, dataType: 'html', complete: function(jqXHR, textStatus ) { jQuery("#loader5").hide(); }, success : function( data, textStatus, jqXHR ) { if (typeof(callback_mehtod) != "undefined") { eval(callback_mehtod + "(data, jqXHR "+param_str+")"); } }, error : function( jqXHR, textStatus, errorThrown) { }, crossDomain: false }); } function make_api_call_simple(params, callback_mehtod) { var param_str = ""; for (var i = 2; i < arguments.length; ++i) { param_str += ", '"+ arguments[i]+"' "; } var url = params.url; jQuery.ajax({ url: url, type: "POST", data: params.data, complete: function(jqXHR, textStatus ) { jQuery("#loader5").hide(); }, success : function( data, textStatus, jqXHR ) { jQuery("#loader5").hide(); if (typeof(callback_mehtod) != "undefined") { eval(callback_mehtod+"(data, jqXHR "+param_str+")"); } }, error : function( jqXHR, textStatus, errorThrown){ jQuery("#loader5").hide(); alert(textStatus) }, crossDomain: false }) } } /** JQUERY CODE**/ function ajax_submitform(url, form_object, call_back, update_element) { jQuery("#loader5").show(); var lbTitle = document.getElementById('lightboxesName').value + ''; lbTitle = treat_text(lbTitle, 'treatsql'); document.getElementById('lightboxesName').value = lbTitle; var lbDesc = document.getElementById('lightboxesDescription').value + ''; lbDesc = treat_text(lbDesc, 'treatsql'); document.getElementById('lightboxesDescription').value = lbDesc; params = new Object(); params.url = url; params.data = jQuery(form_object).serialize(); make_api_call_simple(params, call_back); } function small_addto_lightbox_callback(result, textStatus, errorThrown) { if (typeof(result) != "undefined") { if (result != "") { jQuery('.lightboxes_div').html(result); } } } function lightboxlogin_submitform(url) { jQuery("#loader5").show(); params = new Object(); params.url = url; params.data = jQuery("#frmList").serialize(); make_api_call(params, "lightboxlogin_submitform_login_done"); } function lightboxlogin_submitform_login_done(data, jqXHR) { jQuery("#loader5").hide(); jQuery("#login").html(data); } function lightboxlogin_new_submitform(url) { jQuery("#loader5").show(); params = new Object(); params.url = url; params.data = jQuery("#frmList").serialize(); make_api_call(params, "lightboxlogin_new_submitform_login_done"); } function lightboxlogin_new_submitform_login_done(data, jqXHR) { jQuery("#loader5").hide(); var data = jQuery.parseJSON(data) if(data.status == "failed") { var html = '
    \
    \
    \
     
    \
    \
    \
    \

    '+data.error_msg_heading+':

    \

    '; html += data.error; html += '

    \
    \
    \
    \
     
    \
    \
    \
    '; jQuery("#error_report").html(html); } else { console.log(data); window.location.href = data.url; } } function lightboxTellFriend(form_id) { jQuery("#loader5").show(); params = new Object(); params.url = jQuery("#"+form_id).attr('action'); params.data = jQuery("#"+form_id).serialize(); make_api_call_simple(params, "updatelightboxTellFriend"); } function updatelightboxTellFriend(data, jqXHR) { jQuery("#loader5").hide(); jQuery("#tell").html(data); } function SearchFormSubmit(frmid,obj) { var link_href = obj.attributes["href"].nodeValue; link_href = link_href.replace("/en/","/"); document.getElementById(frmid).action = link_href; document.getElementById(frmid).submit(); return false; } var HFMessageCard = ''; var HFMessageDate = ''; var HFMessageCVV = ''; var HFMessageOwner = ''; function showError4BT (msg) { if(HFMessageCard != '') { msg = msg + HFMessageCard; } if(msg != '') { msg = msg + '
    '; } if(HFMessageDate != '') { msg = msg + HFMessageDate; } if(msg != '') { msg = msg + '
    '; } if(HFMessageCVV != '') { msg = msg + HFMessageCVV; } if(msg != '') { msg = msg + '
    '; } if(HFMessageOwner != '') { msg = msg + HFMessageOwner; } if(msg != '') { msg = msg + '
    '; } if(msg != '' && msg != null ) { var errHTML = '
    \
    \
    \
     
    \
    \
    \
    \

    There was a problem with your entry.

    '; errHTML += '

    '; errHTML += msg ; errHTML += '

    '; errHTML += '
    \
    \
    \
     
    \
    \
    \
    '; jQuery("#errormessage").html(""); jQuery("#errormessage").show(); jQuery("#errormessage").html(errHTML); } else { hideError4BT(); } } function hideError4BT ( ) { jQuery("#errormessage").html(""); jQuery("#errormessage").hide(); } function BTHFValidate(event) { var msg = ''; var ownermsg; if(jQuery('#UsercreditcardsCcOwner').length > 0) { ownermsg = document.getElementById('UsercreditcardsCcOwner').value; } if(!event.isValid && (!event.isPotentiallyValid || event.card == null) ) { if(ownermsg=='') { HFMessageOwner = 'Name on Card cannot be blank.'; jQuery('#UsercreditcardsCcOwner').css('border-color', '#D0041D'); } if (event.target.fieldKey == "expirationDate" ) { HFMessageDate = "Please enter a valid Expiration Date."; } if (event.target.fieldKey == "number" ) { HFMessageCard = "Please enter a valid Credit Card Number."; } if (event.target.fieldKey == "cvv" ) { HFMessageCVV = "Please enter a valid Card Security Code."; } showError4BT(msg); } else if(event.isValid) { if (event.target.fieldKey == "expirationDate" ) { HFMessageDate = ''; } if (event.target.fieldKey == "number" ) { HFMessageCard = ''; } if (event.target.fieldKey == "cvv" ) { HFMessageCVV = ''; } showError4BT(msg); } if(jQuery('#UsercreditcardsCcOwner').length > 0){ if(document.getElementById('UsercreditcardsCcOwner').value!='') { HFMessageOwner = ''; showError4BT(msg); }} } function hideTip(){ jQuery('.jToolTipDiv').hide(); } function bindHideTip(){ jQuery('.close-jtip').bind( "click touchend", function(e) { setTimeout(function (){ hideTip(); }, 300); }); } var verifyCallback = function(response) { jQuery('').attr({ type: 'hidden', id: 'grcVResponse', name: 'grcVResponse' }).prependTo('#gReCaptchaDiv'); jQuery('#gReCaptchaDiv').closest("form").find(':submit').removeAttr("disabled"); }; var onloadCallbackAuto = function() { onloadCallback(); } var captchaTimer = null; var onloadCallback = function() { clearTimeout(captchaTimer); captchaTimer = setTimeout(function() { if( typeof grecaptcha == 'undefined' || grecaptcha == undefined) { jQuery.ajax({ url: 'https://www.google.com/recaptcha/api.js?onload=onloadCallback', dataType: "script", success: onloadCallback }); } else { if ( jQuery('#gReCaptchaDiv').length ) { jQuery('#gReCaptchaDiv').html(""); grecaptcha.render('gReCaptchaDiv', { 'sitekey' : '6LcNRUkbAAAAAFKbfjWEeUlrabM01SO1uqIOhOfj', 'callback' : verifyCallback, 'theme' : 'light' }); } else { } return false; } }, 300); }; function lbCorrectionForm(url) { jQuery("#loader5").show(); params = new Object(); params.url = url; /* select t from y Select h from K select t from y Select h from K */ var vidCorrTitle = document.getElementById('VideocorrectionsTitle').value + ''; vidCorrTitle = treat_text(vidCorrTitle, 'treatsql'); document.getElementById('VideocorrectionsTitle').value = vidCorrTitle; var vidCorrDesc = document.getElementById('VideocorrectionsDescription').value + ''; vidCorrDesc = treat_text(vidCorrDesc, 'treatsql'); document.getElementById('VideocorrectionsDescription').value = vidCorrDesc; params.data = jQuery("#correctionFrm").serialize(); make_api_call(params, "lbCorrectionFormCallBack"); } function lbCorrectionFormCallBack(data, jqXHR) { jQuery("#loader5").hide(); var data = jQuery.parseJSON(data) if(data.status == "failed") { jQuery(".jscorrectionSuccessbox").hide(); jQuery(".jscorrectionErrorbox").show(); javascript: window.scrollTo(0,0); var html_error = ''; jQuery.each( jQuery.parseJSON(data.error_message), function( key, val ){ html_error += "

    "+val+"

    "; }); var vidCorrTitle = document.getElementById('VideocorrectionsTitle').value + ''; vidCorrTitle = treat_text(vidCorrTitle, 'untreatsql'); document.getElementById('VideocorrectionsTitle').value = vidCorrTitle; var vidCorrDesc = document.getElementById('VideocorrectionsDescription').value + ''; vidCorrDesc = treat_text(vidCorrDesc, 'untreatsql'); document.getElementById('VideocorrectionsDescription').value = vidCorrDesc; jQuery("#jscorrection_error").html(html_error); } else { jQuery(".jscorrectionErrorbox").hide(); jQuery("#correctionFormBlock").hide(); jQuery(".jscorrectionSuccessbox").show(); window.scrollTo(0,0); window.scrollTop = 0 Modalbox.resizeToContent(); jQuery(".jscorrection_success p").html(data.success_message); } } function treat_text(txt, t) { try { if(t == 'treatsql') { txt = txt.replace(/[&]nbsp;/g,""); txt = txt.replace(/Select/g, "[-Select-]"); txt = txt.replace(/select/g, "[-select-]"); txt = txt.replace(/SELECT/g, "[-SELECT-]"); } else if(t == 'untreatsql') { txt = txt.replace(/\[\-Select\-\]/g, "Select"); txt = txt.replace(/\[\-select\-\]/g, "select"); txt = txt.replace(/\[\-SELECT\-\]/g, "SELECT"); } } catch(e){} return txt; } function lbcreate_formsubmit(formObject) { jQuery("#loader5").show(); setTimeout(function() { var lightboxesName = document.getElementById('lightboxesName').value; lightboxesName = treat_text(lightboxesName, 'treatsql'); document.getElementById('lightboxesName').value = lightboxesName; var lightboxesDescription = document.getElementById('lightboxesDescription').value; lightboxesDescription = treat_text(lightboxesDescription, 'treatsql'); document.getElementById('lightboxesDescription').value = lightboxesDescription; formObject.submit(); return false; }, 1500); return false; } function select_license_level(item_type) { jQuery.get({ url: SITE_URL_LAN + 'shopping/select_license_level?item_type='+item_type, success: function(response) { jQuery('.LicensLevel_BG').remove(); jQuery('.LicensLevel_Overlay').remove(); jQuery('body').append(response); jQuery(".LicensLevel_BG").show();jQuery(".LicensLevel_Overlay").show(); jQuery(".LicensLevel_BG").click(function() { jQuery(".LicensLevel_BG").hide();jQuery(".LicensLevel_Overlay").hide(); }); jQuery(".LicensLevel_Overlay").click(function(e) { if(e.target !== e.currentTarget) return; jQuery(".LicensLevel_BG").hide();jQuery(".LicensLevel_Overlay").hide(); }); jQuery('#btnSaveLLAndProcced').click(function(){ save_LL__and_procced(); }); } }); } function save_LL__and_procced(frm) { var license = '25'; if(jQuery("#premium_radio_btn").prop("checked") == true ) { license = '28'; } jQuery.get({ url: SITE_URL_LAN + 'shopping/savecart_postlicenselevel?license='+license, success: function(response) { jQuery('.LicensLevel_BG').remove(); jQuery('.LicensLevel_Overlay').remove(); jQuery('body').append(response); jQuery(".LicensLevel_BG").show();jQuery(".LicensLevel_Overlay").show(); } }); } jQuery(document).ready(function($) { jQuery.fn.center = function () { //this.css("position","absolute"); //this.css("top", Math.max(0, ((jQuery(window).height() - jQuery(this).outerHeight()) / 2) + jQuery(window).scrollTop()) + "px"); console.log("window).width", jQuery(window).width(), "this).outerWidth", jQuery(this).outerWidth(), "scrollLeft", jQuery(window).scrollLeft()); this.css("left", Math.max(0, ((jQuery(window).width() - jQuery(this).outerWidth()) / 2) + jQuery(window).scrollLeft()) + "px"); return this; } });