var showme = false; var selectedlightboxid = -99; var selectedlightboxname = ""; var mydomain = "http://www.stockvectors.com"; //alert(mydomain); //alert('www.stockvectors.com'); function addOpt(optValue,optText,frm_name,lstBox_name){ var Box = document.forms[frm_name].elements[lstBox_name]; for(var i=0;i0) { selectedlightboxid = lightboxid; } else { selectedlightboxid = -99; } if (lightboxname!="") { selectedlightboxname = lightboxname; } else { selectedlightboxname = ""; } if (lightboxname!="") { if (document.showme) { displayLoading(true); } Http.get({ url: mydomain+"/js/saveUserLightBoxes.php?LightBoxName="+escape(lightboxname)+"&VectorID="+escape(vectorid), callback: fillLightBoxes, cache: Http.Cache.GetNoCache }); document.frmAddLightbox.txtLightBoxNew.value=''; } else if (lightboxid>0) { if (document.showme) { displayLoading(true); } Http.get({ url: mydomain+"/js/saveUserLightBoxes.php?LightBoxID="+escape(lightboxid)+"&VectorID="+escape(vectorid), callback: fillLightBoxes, cache: Http.Cache.GetNoCache }); } } function getUserLightBoxes() { if (document.showme) { displayLoading(true); } Http.get({ url: mydomain+"/js/getUserLightBoxes.php", callback: fillLightBoxes, cache: Http.Cache.GetNoCache }); } function getDownloadCost(vectorid, anim, coupon) { document.showme = false; if (vectorid>0) { if (document.showme) { displayLoading(true); } var license = 0; for( i = 0; i < document.frmLic.selLicense.length; i++ ) { if( document.frmLic.selLicense[i].checked == true ) license = document.frmLic.selLicense[i].value; } Http.get({ url: mydomain+"/js/getDownloadCost.php?vectorid="+escape(vectorid)+"&anim="+escape(anim)+"&license="+escape(license)+"&coupon="+escape(coupon)+"&action=lic", callback: fillCost, cache: Http.Cache.GetNoCache }); } } function fillLightBoxes(xmlreply) { if (xmlreply.status == Http.Status.OK) { var cbo = document.frmAddLightbox.cboLightBox; var res = xmlreply.responseText; var resarray = res.split("|"); clrOpt('frmAddLightbox','cboLightBox'); addOpt(-99,"- Your Lightboxes -",'frmAddLightbox','cboLightBox'); for (y=1; y < resarray.length; y++) { var dataarray = resarray[y].split(":"); addOpt(dataarray[0],dataarray[1],'frmAddLightbox','cboLightBox'); } obj = getObject( 'AddLightBox' ); if (document.showme) { Effect.Appear('AddLightBox'); } else { Effect.SwitchOff('AddLightBox'); } for (y=0; y < cbo.options.length; y++) { if (selectedlightboxname!="") { if (cbo.options[y].text == selectedlightboxname) { cbo.options[y].selected = true; } } else { if (cbo.options[y].value == selectedlightboxid) { cbo.options[y].selected = true; } } } } else { alert("Error contacting server.\nPlease try again."); } displayLoading(false); } function fillCost(xmlreply) { if (xmlreply.status == Http.Status.OK) { var res = xmlreply.responseText; document.getElementById('total_price').innerHTML = res+" credits"; } else { alert("Error contacting server.\nPlease try again."); } displayLoading(false); } function ratingCallback(xmlreply) { if (xmlreply.status != Http.Status.OK) { alert("Error contacting server.\nPlease try again."); } displayLoading(false); } function saveUserRating(vectorid,rating) { document.showme = true; if (vectorid>0 && rating>0) { if (document.showme) { displayLoading(true); } Http.get({ url: mydomain+"/js/saveUserRating.php?VectorID="+escape(vectorid)+"&Rating="+escape(rating), callback: ratingCallback, cache: Http.Cache.GetNoCache }); document.frmRating.Rating.value = ''; } }