function OnLoadScripts() {

InterNetExplorer();

}

function InterNetExplorer() {
	if (navigator.appName == "Microsoft Internet Explorer"){
		document.getElementById("metanav").style.marginRight = "0px";



		
	}
}

function JewelleryGalleryTable() {
		if (navigator.appName == "Microsoft Internet Explorer"){
		document.getElementById("jewellery_subnav_table").style.width = "155px";
		document.getElementById("jewellery_subnav_table").style.marginLeft = "14px";}
}

function GemstoneGalleryTable() {
if (navigator.appName == "Microsoft Internet Explorer"){
		document.getElementById("subnav_table").style.marginLeft = "28px";}
}

function AdjustGallery() { 

	if (navigator.appName == "Microsoft Internet Explorer"){
		document.getElementById("jewellery_gallery_header").style.marginTop = "-0px";
document.getElementById("jewellery_gallery_hr").style.marginTop = "-17px";
document.getElementById("gallery_table_main").style.marginTop = "-17px";
	}else{
document.getElementById("jewellery_gallery_header").style.marginTop = "0px";
document.getElementById("jewellery_gallery_hr").style.marginTop = "-10px";}

}

function Change_body_div_margin(z) {

	if (navigator.appName == "Netscape"){
		document.getElementById("edit_margin").style.marginTop = z;
		document.getElementById("contact_table1").style.marginTop = z;
		document.getElementById("contact_table2").style.marginTop = z;
	}
	
	if (navigator.appName != "Netscape"){
		document.getElementById("contact_table1").style.marginTop = z;
		document.getElementById("contact_table2").style.marginTop = z;
	}
}


function make_admin_div_bigger() {
document.getElementById("admin_div").style.width = "890px";
document.getElementById("body_table_admin").style.width = "1090px";
}

function upload_another_pic(x, maximum_uploads){



	document.getElementById("file_add_div_" + x).style.visibility = "visible";
	document.getElementById("file_add_div_" + x).style.width = "500px";
	document.getElementById("file_add_div_" + x).style.height = "50px";
	document.getElementById("file_add_div_" + x).style.marginTop = "10px";
	
	if ( x == 2) {
	newMargin = "-110px"
	}
	if ( x == 3) {
	newMargin = "-90px"
	}
	if ( x == 4) {
	newMargin = "-70px"
	}
	if ( x == 5) {
	newMargin = "-50px"
	}
	if ( x == 6) {
	newMargin = "-30px"
	}
	if ( x == 7) {
	newMargin = "-10px"
	}
	if ( x == 8) {
	newMargin = "10px"
	}
	if ( x == 9) {
	newMargin = "30px"
	}
	
	document.getElementById("submit_gemstones").style.marginTop = newMargin;
	
	document.getElementById("upload_another_pic_" + x).style.visibility = "visible";
	x--;
	document.getElementById("upload_another_pic_" + x).style.visibility = "hidden";
	x++;
	if(x == maximum_uploads){
		document.getElementById("upload_another_pic_" + x).style.visibility = "hidden";
		alert('You can upload a maximum of ' + x + ' pictures!');
	}
}


function gallery_picture_big_change(picture_src) {
	document.getElementById("gallery_picture_big").src = picture_src;
}

function gallery_picture_XL_change(id) {

picture_src = document.getElementById("gallery_picture_big").src;

picture_src = picture_src.split("/");


//change number to 6 when working on localhost

site_to_open = "large_image.php?picture_src=" + picture_src[5];

window.open (site_to_open, 'newwindow', config='toolbar=no,menubar=no, scrollbars=no, resizable=no, location=no, directories=no, status=no')
}

function gallery_picture_XL_change_access(id) {

site_to_open = "large_image.php?picture_src=" + id;

window.open (site_to_open, 'newwindow', config='toolbar=no,menubar=no, scrollbars=no, resizable=no, location=no, directories=no, status=no')
}


function gallery_picture_XL_change_jewellery(id) {

picture_src = document.getElementById("gallery_picture_big").src;

picture_src = picture_src.split("/");


//change number to 6 when working on localhost

site_to_open = "large_image_jewellery.php?picture_src=" + picture_src[5];

window.open (site_to_open, 'newwindow', config='toolbar=no,menubar=no, scrollbars=yes, resizable=no, location=no, directories=no, status=no')
}

function window_resize(width, height) {
self.resizeTo(width, height);

window.outerHeight = height;
window.outerWidth = width; 

}

function ChangeColorForProductSelection(v, overORout) {
	if (overORout && navigator.appName == "Netscape") {
		document.getElementById("text" + v).style.color = "orange";
		document.getElementById("title" + v).style.color = "orange";
	}
	
	if (overORout == 0)
	{
		alert("heloo");
		document.getElementById("text" + v).style.color = "#adefd2;";
		document.getElementById("title" + v).style.color = "#a9ef9b";
	}
}

function ChangeColorForProductSelection_out(v) {
		document.getElementById("text" + v).style.color = "#adefd2;";
		document.getElementById("title" + v).style.color = "#a9ef9b";
}

var cut_value = "";
var zero = 0;

function MMselected() {
document.getElementById("mainstone_cut").style.visibility = "hidden";
document.getElementById('boldStuff').innerHTML = 'Pearl Size';
}

function CTselected() {
document.getElementById("mainstone_cut").style.visibility = "visible";
document.getElementById('boldStuff').innerHTML = 'Mainstone';
}


