-1) {
var s = strcode.indexOf("", e);
// Add to scripts array
scripts.push(strcode.substring(s_e+1, e));
// Strip from strcode
strcode = strcode.substring(0, s) + strcode.substring(e_e+1);
}
// Loop through every script collected and eval it
for(var i=0; i
Loading… Please Wait
';
document.getElementById("txtHint").style.display="block";
getSearch(current_parameters);
document.getElementById("comparison").style.display="none";
document.getElementById("comparison").innerHTML="";
document.getElementById("search_engine").style.display="block";
}
function sort_by(sort_field,sort_type) {
document.forma.sort_field.value=sort_field;
document.forma.sort_type.value=sort_type;
//Have to update parameters to insert sort_field and sort_type
if(current_parameters.search("sort_field") !=-1) {
temp=current_parameters.split("sort_field");
temp_2=temp[1].split("&");
temp_2[0]="";
temp_2=temp_2.join("&");
current_parameters=temp[0]+"sort_field="+sort_field+temp_2;
}
else {
current_parameters=current_parameters+"&sort_field="+sort_field;
}
if(current_parameters.search("sort_type") !=-1) {
temp=current_parameters.split("sort_type");
temp_2=temp[1].split("&");
temp_2[0]="";
temp_2=temp_2.join("&");
current_parameters=temp[0]+"sort_type="+sort_type+temp_2;
}
else{
current_parameters=current_parameters+"&sort_type="+sort_type;
}
getSearch(current_parameters);
}
var allDetailsOpen=new Array();
function get_details(gemstone_id) {
xmlhttpd=GetXmlHttpObject();
if (xmlhttpd==null)
{
alert ("Browser does not support HTTP Request");
return;
}
document.formdetails.GEMSTONE_ID.value= gemstone_id;
allDetailsOpen[gemstone_id]=gemstone_id;
var url="get_details.php";
url=url+"?";
url=url+"ID="+gemstone_id;
url=url+"&PartnerID=";
url=url+"&sid="+Math.random()+'&the_charset=';
xmlhttpd.onreadystatechange=stateChanged3;
xmlhttpd.open("GET",url,true);
xmlhttpd.send(null);
}
function stateChanged3()
{
if (xmlhttpd.readyState==4)
{
//document.getElementById("txtHint").style.display="none";
//document.getElementById("details").style.display="block";
//document.getElementById("details").innerHTML=xmlhttpd.responseText;
//alert("document.getElementById('details_"+document.formdetails.GEMSTONE_ID.value+"').style.display='block'");
//Have to close all the opened
for (x in allDetailsOpen)
{
eval("document.getElementById('details_"+x+"').style.display='none'");
}
eval("document.getElementById('details_"+document.formdetails.GEMSTONE_ID.value+"').style.display='block'");
eval("document.getElementById('details_"+document.formdetails.GEMSTONE_ID.value+"').innerHTML=xmlhttpd.responseText");
eval("location.href='#anchor_"+document.formdetails.GEMSTONE_ID.value+"'");
}
}
function hide_details() {
//document.getElementById("txtHint").style.display="block";
//document.getElementById("details").style.display="none";
//Delete elemnt from array
allDetailsOpen=allDetailsOpen.splice(document.formdetails.GEMSTONE_ID,1);
eval("document.getElementById('details_"+document.formdetails.GEMSTONE_ID.value+"').style.display='none'");
}
function enlarge_picture(source,w,h){
new_h=h+50;
//w=window.open('','Large_picture','height='+w+',width='+h+',toolbar=no,menubar=no,statusbar=no,addressbar=no');
var win=window.open("","LabImgWin","toolbar=no,menubar=no,location=no,scrollbars=no,resizable=no,status=no,width="+w+",height="+new_h+",left=200,top=50" );
win.document.write('Image Window');
win.document.write("
");
win.document.close();
win.focus();
}
function open_print(){
mywindow=window.open('print_page.php','print_page','width=100,height=100');
mywindow.moveTo(-500,-500);
}
function add_to_shpping_cart(){
document.getElementById('div_overlay_added_to_sc').className = 'overlay';
document.getElementById('div_added_to_sc').style.display = 'block';
document.getElementById('div_overlay_quick_view').className = '';
document.formdetails.action="sc_oprations.php";
document.formdetails.target="submit_iframe";
document.formdetails.operation.value="add";
document.formdetails.submit();
//hide_details();
//window.close();
}
function add_to_wish_list(){
document.formdetails.action="sc_oprations.php";
document.formdetails.target="submit_iframe";
document.formdetails.operation.value="add_w_l";
document.formdetails.submit();
//hide_details();
//window.close();
}
function express_check_out() {
document.formdetails.action="sc_oprations.php";
document.formdetails.target="submit_iframe";
document.formdetails.operation.value="add_and_checkout";
document.formdetails.submit();
}
function display_store_locator(gemstone_id){
html_string="";
eval("document.getElementById('details_"+document.formdetails.GEMSTONE_ID.value+"').innerHTML=html_string");
}
function display_login(gem_id) {
eval("login_div_"+gem_id+".style.display='block'");
}
function change_user(u) {
document.form_login.username.value=u;
}
function change_pass(p) {
document.form_login.password.value=p;
}
function check_user_pass(g){
document.form_login.action="background_login.php";
document.form_login.target="submit_iframe";
document.form_login.gemstone_id.value=g;
document.form_login.submit();
}
function Left(str, n){
if (n <= 0)
return "";
else if (n > String(str).length)
return str;
else
return String(str).substring(0,n);
}
function remove_from_search(search_var) {
if(search_var=="GemType")
gem_type_changes("");
if(search_var=="CategoryID")
category_change("");
if(search_var=="SubCategoryID")
category_change("");
if(search_var=="ShapeID")
shape_selected("");
if(search_var=="ColorID") {
document.forma.ColorID.value=0; //Update indicator only with color
document.forma.ToneID.value=0;
document.forma.SaturationID.value=0;
update_current_parameters("ColorID");
update_current_parameters("ToneID");
update_current_parameters("SaturationID");
document.getElementById('square_image').src="../blank.png";
getSearch(current_parameters);
//document.forma.submit();
}
if(search_var=="carat_from")
weight_change("");
if(search_var=="length_from")
length_change("");
if(search_var=="price_to")
price_change("-");
if(Left(search_var,12)=="shape_radio_") {
zz= search_var.split("radio_");
shape_checked(zz[1],false) ;
}
if(search_var=="search_word") {
document.formsearch.search_word.value="";
document.formsearch.submit();
}
if(search_var=="metal") {
metal_changes("");
}
if(search_var=="stone_type") {
//initialize_gemstones();
//initialize_diamonds();
//initialize_colored_diamonds();
gem_type_changes(0);//Init to gemstones
document.forma.stone_type.value="";
update_current_parameters("stone_type");
getSearch(current_parameters);
}
}
function display_option_change(display_value) {
// Open when want automatic search
field_to_split="&display_option=";
temp=current_parameters.split(field_to_split);
temp_2=temp[1].split("&");
temp_2[0]="";
temp_2=temp_2.join("&");
current_parameters=temp[0]+"&display_option="+display_value+temp_2;
field_to_split="&display_option_2=";
temp=current_parameters.split(field_to_split);
temp_2=temp[1].split("&");
temp_2[0]="";
temp_2=temp_2.join("&");
current_parameters=temp[0]+"&display_option_2="+display_value+temp_2;
getSearch(current_parameters);
}
function change_display_method(dm) {
document.forma.display_option.value=dm;
document.forma.display_option_2.value=dm;
//document.forma.submit();
update_current_parameters("display_option");
update_current_parameters("display_option_2");
getSearch(current_parameters);
}
function change_sorting_method(a,b) {
document.forma.sort_field.value=a;
document.forma.sort_type.value=b;
update_current_parameters("sort_field");
update_current_parameters("sort_type");
getSearch(current_parameters);
}
function sel_id_selected() { //Empty function for working the colored diamond square compatible with the list_item
}