//------------------------------------------- LightBox
var lightTimer = 0;
var opacStep = 0;
var opac_value = 70;
var screenRes = 0;
var scrollBarWidth = 0;
var isIE = false;
var isIE6 = false;
var isSafari = false;
var contentWidth = 0;
var obj_import = false;
var cacheimage = new Image();
cacheimage.src = "http://www.clevereveassets.com/img/new_ajax-loader.gif";
var listing_id=0;
function getBrowserType(){
	if ((navigator.userAgent.indexOf("MSIE 6")) >= 0){
		isIE6 = true;
		return;
	}
	if ((navigator.userAgent.indexOf("MSIE")) >= 0){
		isIE = true;
		return;
	}
	if ((navigator.userAgent.indexOf("Safari")) >= 0){
		isSafari = true;
		return;
    }
   	return false;
}
getBrowserType();
function getScrollBarWidth () {
	var inner = document.createElement('p');
	inner.style.width = '100%';
	inner.style.height = '200px';
 
	var outer = document.createElement('div');
	outer.style.position = 'absolute';
	outer.style.top = '0px';
	outer.style.left = '0px';
	outer.style.visibility = 'hidden';
	outer.style.width = '200px';
	outer.style.height = '150px';
	outer.style.overflow = 'hidden';
	outer.appendChild (inner);
 
	document.body.appendChild (outer);
	var w1 = inner.offsetWidth;
	outer.style.overflow = 'scroll';
	var w2 = inner.offsetWidth;
	if (w1 == w2)
		w2 = outer.clientWidth;
	document.body.removeChild (outer);
 
	return (w1 - w2);
};
function screenSize() {
	var w, h; 
 	w = (window.innerWidth ? window.innerWidth : (document.documentElement.clientWidth ? document.documentElement.clientWidth : document.body.offsetWidth));
    h = (window.innerHeight ? window.innerHeight : (document.documentElement.clientHeight ? document.documentElement.clientHeight : document.body.offsetHeight));
    return {w:w, h:h};
}
function ajaxLoadingIndicate(mainContentDiv){
	mainLightDiv = document.getElementById("mainLightDiv");
	if(mainLightDiv){
		if(!document.getElementById("ajaxLoadingIndicator")){
			ajax_load = document.createElement("IMG");
			ajax_load.style.zIndex = "10000100";
			ajax_load.style.position = "absolute";
			ajax_load.id = "ajaxLoadingIndicator";
			ajax_load.src = cacheimage.src;
			ajax_load.style.width = "62px";
			ajax_load.style.height = "13px";
			ajax_load.style.top = Math.floor((screenRes.h/2)) + "px";
			ajax_load.style.left = Math.floor((screenRes.w/2 - 31)) + "px";						
			mainLightDiv.appendChild(ajax_load);
		}else{
			mainLightDiv.removeChild(document.getElementById("ajaxLoadingIndicator"));
		}
		return true
	}
	return false	
}
function lightBoxActivateContent(){
	mainContentDiv = document.getElementById("lightBoxContent");
	if(mainContentDiv){
		ajaxLoadingIndicate();
		var obj_import = getTooltip();		
	}
/*	if(mainContentDiv){
			close_btn = document.createElement("DIV");
			close_btn.className = "lightBoxCloseBtn";
			close_btn.innerHTML = "<span>Close</span><div></div>";
			close_btn.onclick = function(){
				deactivateLightBox();
			}
			mainContentDiv.appendChild(close_btn);
	}*/
		if(mainContentDiv){
			var obj_text = document.createElement("DIV");
			obj_text.className = "lightBoxContentText";
			obj_text.id = "lightBoxContentText";
//			if(obj_import.className){obj_import_className = obj_import.className;}else{obj_import_className = "";}
			obj_text.innerHTML ="<div id='lightBoxContentTextIncl'  style='background-color: #FFFFFF; width: 642px; height: 193px; white-space: nowrap;'>" + obj_import + "</div>";
			mainContentDiv.appendChild(obj_text);
			setBegoonValues();
			getOtherRings();
			if(document.getElementById("pacr_back_params")){
				setBackValues(document.getElementById("pacr_back_params").value);
			}else{setPrevTrackVal(0);}
			var obj_import = document.getElementById("lightBoxContentTextIncl");
			var contentWidth = obj_import.offsetWidth;	
			var set_left = Math.round(((screenRes.w - scrollBarWidth)/2) - (obj_text.offsetWidth/2));
			if(set_left < 1){set_left = 1;}
			if(obj_text.offsetWidth > screenRes.w){
				mainLightDiv = document.getElementById("mainLightDiv");
				if(mainLightDiv){
					mainLightDiv.style.width = obj_text.offsetWidth + 2 + "px";
				}	
			}
			var set_top = Math.round((screenRes.h/2) - (obj_text.offsetHeight/2));
			if(set_top < 10){set_top = 10;}
			if(obj_text.offsetHeight > screenRes.h){
				mainLightDiv = document.getElementById("mainLightDiv");
				if(mainLightDiv){
					mainLightDiv.style.height = obj_text.offsetHeight + 2 + "px";
				}
				if(obj_text){
					obj_text.style.height = screenRes.h - 26 + "px";
					obj_text.style.overflowY = "scroll";
					obj_text.style.overflowX = "hidden"
					obj_text.style.width = parseInt(contentWidth)+ scrollBarWidth + "px";
				}	
			}else{
				obj_text.style.overflowY = "hidden";
				obj_text.style.overflowY = "hidden"								
			}
			obj_text.style.left = set_left + "px";
			obj_text.style.top = set_top + "px";
			window.onresize = function(){
  				changeLightBoxSize();  
	 		}
	}
}
function changeLightBoxSize(){
	var screenRes = screenSize();
	var mainLightDiv = document.getElementById("mainLightDiv");
	var obj_text = document.getElementById("lightBoxContentText");
	var transpLightDiv = document.getElementById("transpLightDiv");
	var ajax_indicator = document.getElementById("ajaxLoadingIndicator");
	if(ajax_indicator){
		ajax_load.style.top = Math.floor((screenRes.h/2)) + "px";
		ajax_load.style.left = Math.floor((screenRes.w/2 - 31)) + "px";		
	}
	if(mainLightDiv){
		if(!isIE6){
			if(!isIE){		
				mainLightDiv.style.width = Math.floor(screenRes.w - scrollBarWidth) + "px";
			}
			if(isIE){		
				mainLightDiv.style.width = screenRes.w + "px";
			}
		}else{
			mainLightDiv.style.width = screenRes.w + "px";			
		}
		mainLightDiv.style.height = screenRes.h + "px";
		transpLightDiv.style.width = mainLightDiv.offsetWidth + "px";
		transpLightDiv.style.height = screenRes.h + "px";
	}
	if(obj_text){
		var set_left = Math.round(((screenRes.w - scrollBarWidth)/2) - (obj_text.offsetWidth/2));
		if(set_left < 1){set_left = 1;}
		//obj_text.style.height = "auto";		
		var set_top = Math.floor((screenRes.h/2) - (obj_text.offsetHeight/2));		
		if(set_top < 10){set_top = 10;}
	/*	if(obj_text.offsetHeight > screenRes.h){
			mainLightDiv = document.getElementById("mainLightDiv");
			if(obj_text){
				obj_text.style.height = screenRes.h - 26 + "px";
				obj_text.style.overflowY = "scroll";
				obj_text.style.overflowX = "hidden"				
				obj_text.style.width = parseInt(contentWidth)+ scrollBarWidth + "px";
			}	
		}else{
			obj_text.style.width = parseInt(contentWidth) + "px";
			obj_text.style.overflowX = "hidden";
			obj_text.style.overflowY = "hidden";							
		}*/

		
		obj_text.style.left = set_left + "px";
		obj_text.style.top = set_top + "px";
	}
}
function lightBoxTransp(obj_id, action){
	obj = document.getElementById(obj_id);
	if(obj){
		if(parseInt(action) == 1){
			if(opacStep < opac_value){
				opacStep += 5; 	
			}else{
				mainContentDiv = document.getElementById("lightBoxContent");
					if(mainContentDiv){
						clearInterval(lightTimer);
						lightBoxActivateContent();
						corrSplitPrice();
					} 
				}
		}
		if(parseInt(action) == 2){
			if(opacStep > 0){
				opacStep -= 5;
			}else{
					mainLightDiv = document.getElementById("mainLightDiv");
					if(mainLightDiv){
						document.body.removeChild(mainLightDiv);
					}	
					clearInterval(lightTimer)
				}
		}
		obj.style.opacity = opacStep / 100;	
		obj.style.MozOpacity = opacStep / 100;	
		obj.style.KhtmlOpacity = opacStep / 100;
		obj.style.filter = "alpha(opacity = "+opacStep+")";
	}
}
function deactivateLightBox(){
	mainLightDiv = document.getElementById("mainLightDiv");
	mainContentDiv = document.getElementById("lightBoxContent");
	if(mainLightDiv && mainContentDiv){
		clearInterval(err_timer);
		mainLightDiv.removeChild(mainContentDiv);
	}
	if(mainLightDiv){
		opacStep = opac_value;
		lightTimer = setInterval("lightBoxTransp('transpLightDiv',2)",5);
	}
}

function activateLightBox(list_id){
//	if(obj_import = document.getElementById(get_id)){
		list_id=parseInt(list_id);
		if (list_id>0) listing_id=list_id;
		else listing_id=0;
	if(!isNaN(listing_id) && listing_id > 0){
		screenRes = screenSize();
		scrollBarWidth = getScrollBarWidth();
		mainLightDiv = document.createElement("DIV");
		mainLightDiv.style.zIndex = "10000000";
		mainLightDiv.id = "mainLightDiv";
		if(!isIE6){
			mainLightDiv.style.position = "fixed";		
			mainLightDiv.style.top = "0px";
			mainLightDiv.style.left = "0px";
			if(!isIE){		
				mainLightDiv.style.width = screenRes.w - scrollBarWidth + "px";
			}
			if(isIE){		
				mainLightDiv.style.width = screenRes.w + "px";
			}
		}else{
			mainLightDiv.className = "mainLightDiv";
			mainLightDiv.style.width = screenRes.w + "px";
		}
		mainLightDiv.style.height = screenRes.h + "px";
		mainLightDiv.style.border = "0px solid red";	
		document.body.appendChild(mainLightDiv);
		if(mainLightDiv){
			obj_content = document.createElement("DIV");
			obj_content.className = "lightBoxContent";
			obj_content.id = "lightBoxContent";
			mainLightDiv.appendChild(obj_content);
		}	
		if(mainLightDiv){
			transpLightDiv = document.createElement("DIV");
			transpLightDiv.style.zIndex = "10000001";
			transpLightDiv.style.position = "absolute";
			transpLightDiv.id = "transpLightDiv";
			transpLightDiv.style.top = "0px";
			transpLightDiv.style.left = "0px";	
			transpLightDiv.style.width = mainLightDiv.offsetWidth + "px";
			transpLightDiv.style.height = screenRes.h + "px";
			transpLightDiv.style.opacity = 0;	
			transpLightDiv.style.MozOpacity = 0;	
			transpLightDiv.style.KhtmlOpacity = 0;
			transpLightDiv.style.filter = "alpha(opacity = 0)";
			transpLightDiv.style.backgroundColor = "#000000";	
			mainLightDiv.appendChild(transpLightDiv);
			if(transpLightDiv){
				ajaxLoadingIndicate();
				lightTimer = setInterval("lightBoxTransp('transpLightDiv',1)",5);
			}
		}
	}
}
function getObjHead(id){
	var obj = document.getElementById(id);
	var curr_head = false;
	if(obj){
		curr_obj_check = obj.getElementsByTagName("DIV");
		if(curr_obj_check.length > 0){
			for(i=0; i< curr_obj_check.length > 0; i++){
				if(curr_obj_check[i].className == "lb_el_head"){
					curr_head = curr_obj_check[i];	
				}
			}
		}	
	}
	return curr_head;
}
var err_color = new Array();
var err_timer;
var err_heads = new Array();
function errColorSet(){
	if(err_heads.length > 0){
		err_color[0] -= 2;	if(err_color[0] < 96){err_color[0] = 96;}
		err_color[1] += 2;	if(err_color[1] > 96){err_color[1] = 96;}
		err_color[2] += 2;	if(err_color[2] > 96){err_color[2] = 96;}					
		for(j=0; j<err_heads.length; j++){
			err_heads[j].style.color = "rgb("+err_color[0]+","+err_color[1]+","+err_color[2]+")";
			if(err_color[0] == 96 && err_color[1] == 96 && err_color[2] == 96){clearInterval(err_timer);}
		}
	}else {clearInterval(err_timer);}
}
function checkBefore_Submit(params){
	if(params){
		err_heads = new Array();
		var curr_obj_check = "";
		var err_found = "";	
		var hid_string = "";
		var err_string = new Array();
		if(getObjHead("lb_osc")){
			err_heads.push(getObjHead("lb_osc"));
			err_heads[err_heads.length - 1].style.color = "rgb(96,96,96)";
			curr_obj_check = err_heads[err_heads.length-1].parentNode.getElementsByTagName("SELECT");
			if(curr_obj_check.length == 2){
				if(curr_obj_check[0].selectedIndex != 0 && curr_obj_check[1].selectedIndex != 0){
					err_heads.pop();
					for(i=0; i<curr_obj_check.length; i++){
						hid_string += curr_obj_check[i].name + "=" + curr_obj_check[i].options[curr_obj_check[i].selectedIndex].value + ";";
					}
				}else{err_string.push("Optional Search Criteria"); err_found += 1;}
			}
		}else{err_found += 1;}
		if(getObjHead("lb_cds")){
			err_heads.push(getObjHead("lb_cds"));
			err_heads[err_heads.length - 1].style.color = "rgb(96,96,96)";			
			curr_obj_check = err_heads[err_heads.length-1].parentNode.getElementsByTagName("INPUT");
			var check_input = 0;
			if(curr_obj_check.length > 0){
				for(i=0; i<curr_obj_check.length; i++){
					if(curr_obj_check[i].checked == true){
						check_input += 1;
						hid_string += curr_obj_check[i].name + "=" + curr_obj_check[i].value + ";"; 
					}
				}
				if(check_input != 0){err_heads.pop();}else{err_string.push("Center Diamond Shape");}
			}
		}else{err_found += 1;}
		if(getObjHead("lb_cdsize")){
			err_heads.push(getObjHead("lb_cdsize"));
			err_heads[err_heads.length - 1].style.color = "rgb(96,96,96)";			
			curr_obj_check = err_heads[err_heads.length-1].parentNode.getElementsByTagName("INPUT");
			if(curr_obj_check.length > 0){
				for(i=0; i<curr_obj_check.length; i++){
					if(curr_obj_check[i].type == "hidden" && curr_obj_check[i].name == "current_begoon_value"){
						if(curr_obj_check[i].value && curr_obj_check[i].value != "0"){
							err_heads.pop();
							hid_string += curr_obj_check[i].name + "=" + curr_obj_check[i].value + ";";	
						}else{err_string.push("Center Diamond Size (ct)"); err_found += 1;}
					}
				}
			}
		}else{err_found += 1;}
		if(params == "save"){
			if(err_heads.length > 0){
				var err_alert = "Please Select all Parameters";
				if(err_string.length > 0){
					err_alert += " ( "
					for(i=0; i<err_string.length; i++){
						err_alert += err_string[i] + ((i<err_string.length-1)?", ":"");
					}
					err_alert += " )"
				}
				alert(err_alert);
				err_color = new Array(255,0,0);
				err_timer = setInterval("errColorSet()",30);
				return false;
			}else{setSubmit_Values(hid_string);}
		}
		if(params == "ajax"){
			if(err_heads.length === 0){
				return hid_string;
			}else{return false;}
		}
	}			
}
function setSubmit_Values(params){
	var  met_content = document.getElementById("metal_content").getElementsByTagName("INPUT");
	if(params && met_content && met_content.length > 0){
		for(i=0; i<met_content.length; i++){
			if(met_content[i].type == "radio" && met_content[i].checked == true){
				//params += met_content[i].name + "=" + met_content[i].value + ";";
				var get_id = met_content[i].parentNode.getElementsByTagName("INPUT"); 
				for(j=0; j<get_id.length; j++){
					if(get_id && get_id[j].type == "hidden" && get_id[j].name == "id" && !isNaN(parseInt(get_id[j].value))){
						params += "ring_id=" + 	get_id[j].value;					
					}
				}
			}
		}
		var new_ring_form = document.forms['new_ring_form'];
		if(new_ring_form){
			var get_params_val = params.split(";");
			if(get_params_val.length > 0){
				for(i=0; i<get_params_val.length; i++){
					if(get_params_val[i].split("=").length == 2){
						var form_hid = document.createElement("INPUT");
						if(form_hid){
							form_hid.type = "hidden";
							form_hid.name = get_params_val[i].split("=")[0];
							form_hid.value = get_params_val[i].split("=")[1];
							new_ring_form.appendChild(form_hid);						
						}
					}
				}
				document.forms["new_ring_form"].submit();				
			}
		}
	}
}
//------------------------------------------- LightBox
function setBackValues(params){
	if(params){
		params = params.split(";");
		if(params.length > 0){
			for(i=0; i<params.length; i++){
				if(params[i].split("=")[0] == "color" || params[i].split("=")[0] == "clarity"){
					var d_downs = document.getElementById("lb_osc");
					if(d_downs){
						d_downs = d_downs.getElementsByTagName("SELECT");
						if(d_downs.length > 0){
							for(j=0; j<d_downs.length; j++){
								if(d_downs[j].name == "diam_" + params[i].split("=")[0]){
									if(d_downs[j].options.length > 0){
										for(k=0; k<d_downs[j].options.length; k++){
											if(d_downs[j].options[k].value == params[i].split("=")[1]){
												d_downs[j].options[k].selected = "selected";
											}
										}
									}
								}
							}
						}
					}
				}
				if(params[i].split("=")[0] == "shape"){
					var all_shapes = document.getElementById("lb_cds");
					if(all_shapes){
						all_shapes = all_shapes.getElementsByTagName("INPUT");
						if(all_shapes.length > 0){
							for(j=0; j<all_shapes.length; j++){
								if(all_shapes[j].type == "radio" && all_shapes[j].value == params[i].split("=")[1].toLowerCase()){
									all_shapes[j].checked = true;
								}
							}
						}
					}
				}
				if(params[i].split("=")[0] == "carat_weight"){
					var get_begoon_main = document.getElementById("begoon_main");
					if(get_begoon_main){
						setPrevTrackVal(params[i].split("=")[1]);
					} 
				}
			}
		}
	}
}
var begun_move_points = new Array();
function setBegoonValues(){
	var obj = document.getElementById("begoon_main");
	if(obj){
		var b_values = obj.getElementsByTagName("INPUT");
		var params = "";
		if(b_values.length > 0){
			for(i=0; i<b_values.length; i++){
				if(b_values[i].name == "begoon_values"){
					params = b_values[i].value.split(",");	
				}
			}
		}
		if(params.length > 0){
			var b_ball_w = document.getElementById("begoon_ball").offsetWidth;
			var b_line = parseInt(document.getElementById("begoon_line").offsetWidth) - 1;
			if(isNaN(parseInt(b_ball_w))){b_ball_w = 13;}
			for(i=0; i<2; i++){
				var new_point = document.createElement("div");
				new_point.style.position = "absolute";
				new_point.style.left = ((i==1)?"0px":b_line+"px");
				//new_point.id = ((i==1)?"":"test_view");
				new_point.className = "begun_vline";				
				obj.appendChild(new_point);
			}
			for(i=0; i<params.length; i++){
				var new_point = document.createElement("div");
				new_point.style.position = "absolute";
				begun_move_points[i] = new Array();
				begun_move_points[i][0] = params[i];
				begun_move_points[i][1] = Math.ceil(b_ball_w + ((parseInt(b_line)-b_ball_w*2)/(params.length-1))*(i));
				new_point.style.left = begun_move_points[i][1] + "px";
				new_point.className = "begun_vline";
				obj.appendChild(new_point);
				new_point.innerHTML = "<div style='position: absolute; top: 16px;'>" + params[i] + "</div>";
				var corr_left = new_point.getElementsByTagName("DIV")[0];
				if(corr_left){
					corr_left.style.left = 0 - (corr_left.offsetWidth/2) + "px";
				}
			}//alert(begun_move_points);
		}
	}
}
var rings_values = new Array();
function getOtherRings(){
	var obj = document.getElementById("other_rings");
	var metal_obj = document.getElementById("metal_content");
	if(obj && metal_obj){
		rings_values = obj.value.split(";");
		var cur_ring = document.getElementById("current_ring");
		if(rings_values.length > 1  && cur_ring){
			var rings_content = "";
			for(i=0; i<rings_values.length; i++){
				var tmp_values = rings_values[i].split("+");
				rings_values[i] = new Array();
				if(tmp_values.length == 7){
					rings_values[i] = tmp_values;
					var attach_content = document.createElement("DIV");
					attach_content.className = "lb_mtype";
					attach_content.innerHTML = '<input type="hidden" value="'+i+'" name="pos"><input type="hidden" value="'+rings_values[i][6]+'" name="id"><input type="radio" value="'+rings_values[i][5]+'" name="ring_metal" onclick="changeRingParams(this.parentNode); corrSplitPrice();" '+((cur_ring.value == rings_values[i][1])?' checked="checked" ':'')+' /><div class="'+rings_values[i][4]+'"></div>'+rings_values[i][5];
					metal_obj.appendChild(attach_content);
				}
			}
		}	
	}
	var curr_ring_size = document.getElementById("ring_size").options[document.getElementById("ring_size").selectedIndex].value;
	if(curr_ring_size && document.forms["new_ring_form"]){
		var form_hid = document.createElement("INPUT");
		if(form_hid){
			form_hid.type = "hidden";
			form_hid.name = "ring_size";
			form_hid.value = curr_ring_size;
			document.forms["new_ring_form"].appendChild(form_hid);						
		}		
	}
}
function changeRingParams(obj){
	if(obj){
		var get_val = obj.getElementsByTagName("INPUT");
		if(get_val.length > 0){
			for(i=0; i<get_val.length; i++){
				if(get_val[i].type == "hidden" && get_val[i].name == "pos"){
					if(!isNaN(get_val[i].value)){
						var main_image = document.getElementById("mainRingImage");
						var ring_price = document.getElementById("lb_ring_price");
						if(main_image){
							main_image.src = "http://www.clevereveassets.com/uploads/images/" + rings_values[get_val[i].value][2];
/*							if(ring_price){
								ring_price.innerHTML = "$" + rings_values[get_val[i].value][3];
							}*/
						}
					}
				}
			}
		}
	}
}
function getXmlHttp(){
  var xmlhttp;
  try {
    xmlhttp = new ActiveXObject("Msxml2.XMLHTTP");
  } catch (e) {
    try {
      xmlhttp = new ActiveXObject("Microsoft.XMLHTTP");
    } catch (E) {
      xmlhttp = false;
    }
  }
  if (!xmlhttp && typeof XMLHttpRequest!='undefined') {
    xmlhttp = new XMLHttpRequest();
  }
  return xmlhttp;
}
function getTooltip(){
	if(!isNaN(listing_id) && listing_id > 0){
		var xmlhttp = getXmlHttp();
		xmlhttp.open('GET', '/product_tooltip.php?pid='+listing_id, false);
		xmlhttp.send(null);
		if(xmlhttp.status == 200) {
			var result = xmlhttp.responseText;
			return result;
		} 
	}
}
function getPacrPrice(params){
	if(params){
		var xmlhttp = getXmlHttp();
		xmlhttp.open('GET', '/pacr_price.php?p='+params, false);
		xmlhttp.send(null);
		if(xmlhttp.status == 200) {
			var result = xmlhttp.responseText;
			if(result){
				setDiamondAndPrice(result); 
			//	alert(result);
			/*	if(!isNaN(parseInt(result))){
					ring_price.innerHTML = "$" + result;
				}else{ring_price.innerHTML = "$0";}*/
			}
		} 
	}
}
function setDiamondAndPrice(params){
	var ring_price = document.getElementById("lb_ring_price");
	var ring_img = document.getElementById("mainRingImage");	
	if(ring_price && ring_img && params){
		params = params.split(";");
		if(params.length == 2){
			ring_img.src = params[0];
			if(!isNaN(parseInt(params[1]))){
					ring_price.innerHTML = "$" + params[1];
			}else{ring_price.innerHTML = "$0";}
		}
	}	
}
function corrSplitPrice(){
	var params = checkBefore_Submit("ajax");
	var metal_obj = document.getElementById("metal_content");
	var ring_price = false;
	if(metal_obj){
		metal_obj = metal_obj.getElementsByTagName("INPUT");
		for(i=0; i< metal_obj.length; i++){
			if(metal_obj[i].type == "radio" && metal_obj[i].checked === true){
				var get_id = metal_obj[i].parentNode.getElementsByTagName("INPUT");
				for(j=0; j<get_id.length; j++){
					if(get_id[j].type == "hidden" && get_id[j].name == "id"){
						if(params){params += "ring_id=" + get_id[j].value;}	
					}
					if(get_id[j].type == "hidden" && get_id[j].name == "pos" && !isNaN(get_id[j].value)){
						ring_price = rings_values[get_id[j].value][3]
					}
				}
			}
		}
		if(params){getPacrPrice(params)};
	}
	if(!params){
		var obj_price = document.getElementById("lb_ring_price");
		if(ring_price){
			if(obj_price){
				obj_price.innerHTML = "$" + ring_price;
			}
		}else{
			obj_price.innerHTML = "$0";
		}
	}
}
