
function find_size() {
	var obj= parent.top.document.getElementById('catalogue_div');
	
	if (window.innerWidth) { //if browser supports window.innerWidth
		obj.style.top = (parent.top.window.innerHeight/2)-250;
		obj.style.left = (parent.top.innerWidth/2)-380;
		}
		else if (document.all) { //else if browser supports document.all (IE 4+)
			obj.style.top = (parent.top.document.body.clientHeight/2)-250;
			obj.style.left = (parent.top.document.body.clientWidth/2)-380;
			}
	}
window.onresize = find_size;


function toggleCatalogue() {
	if(document.getElementById('catalogue_div').style.display == '') {
		document.getElementById('catalogue_div').style.display = 'none';
		document.getElementById('dark_back').style.display = 'none';
		}
		else {
			document.getElementById('catalogue_div').style.display = '';
			document.getElementById('dark_back').style.display = '';
			}
	}

function close_catalogue() {
	parent.top.document.getElementById('catalogue_div').style.display = 'none'
	parent.top.document.getElementById('dark_back').style.display = 'none';
	document.getElementById('catalogue_page').src = "stones.php?0";
	}

function change_category(which_one) {
	document.getElementById('catalogue_page').src = "stones.php?"+which_one;
	}

function show_img(file_name,category,price,width,height) {
	parent.document.getElementById('large_img').src = "images/"+category+"/large_thumbs/"+file_name;
	parent.document.getElementById('large_img').width = width;
	parent.document.getElementById('large_img').height = height;
	parent.document.getElementById('stone_price').innerHTML = price;
	parent.document.forms.hidden_info.current_stone_id.value = file_name;
	}

function select(category) {
	var id = document.forms.hidden_info.current_stone_id.value;
	document.location.href = "send_mail.php?"+id+","+category;
	}


