var page1 = document.getElementById('page1');
var page2 = document.getElementById('page2');
var page3 = document.getElementById('page3');
var page4 = document.getElementById('page4');
var page5 = document.getElementById('page5');
var page6 = document.getElementById('page6');

var clarity_text = document.getElementById('clarity-text');
var clarity_img = document.getElementById('clarity-img');
var cut_anatomy = document.getElementById('cut-anatomy');
var cut_grading = document.getElementById('cut-grading');
var tab1 = document.getElementById('tab1');
var tab2 = document.getElementById('tab2');

var ads1 = document.getElementById('ads1');
var ads2 = document.getElementById('ads2');
var ads_switch = true;

var shopping = document.getElementById('shopping');







function gotoWeight() {	
	page1.style.left = "320px";
	page2.style.left = "0px";
	page3.style.left = "320px";
	page4.style.left = "320px";
	page5.style.left = "320px";
	page6.style.left = "320px";
	ads1.style.visibility = "hidden";
	ads2.style.visibility = "hidden";
}

function gotoColour() {
	page1.style.left = "320px";
	page2.style.left = "320px";
	page3.style.left = "0px";
	page4.style.left = "320px";
	page5.style.left = "320px";
	page6.style.left = "320px";
	ads1.style.visibility = "hidden";
	ads2.style.visibility = "hidden";
}

function gotoClarity() {
	page1.style.left = "320px";
	page2.style.left = "320px";
	page3.style.left = "320px";
	page4.style.left = "0px";
	page5.style.left = "320px";
	page6.style.left = "320px";
	ads1.style.visibility = "hidden";
	ads2.style.visibility = "hidden";
}

function gotoCut() {
	page1.style.left = "320px";
	page2.style.left = "320px";
	page3.style.left = "320px";
	page4.style.left = "320px";
	page5.style.left = "0px";
	page6.style.left = "320px";
	ads1.style.visibility = "hidden";
	ads2.style.visibility = "hidden";
}

function gotoShop() {
	page1.style.left = "320px";
	page2.style.left = "320px";
	page3.style.left = "320px";
	page4.style.left = "320px";
	page5.style.left = "320px";
	page6.style.left = "0px";
	if (ads_switch) {
		ads1.style.visibility = "hidden";
		ads2.style.visibility = "visible";
		ads_switch = false;
	} else {
		ads1.style.visibility = "visible";
		ads2.style.visibility = "hidden";
		ads_switch = true;
	}
	shopInfo(0);
}

function goback() {
	page1.style.left = "0px";
	page2.style.left = "320px";
	page3.style.left = "320px";
	page4.style.left = "320px";
	page5.style.left = "320px";
	page6.style.left = "320px";
	if (ads_switch) {
		ads1.style.visibility = "hidden";
		ads2.style.visibility = "visible";
		ads_switch = false;
	} else {
		ads1.style.visibility = "visible";
		ads2.style.visibility = "hidden";
		ads_switch = true;
	}
}

function getClarity(i) {
	switch (i) {
		case "1":
			clarity_text.innerHTML = "FL-IF<br><br>Internally Flawless";
			clarity_img.style.backgroundPosition = "0px 0px";
			break;
		case "2":
			clarity_text.innerHTML = "VVS<sub>1</sub>/VVS<sub>2</sub><br><br>Very Very Slight Inclusions";
			clarity_img.style.backgroundPosition = "0px -60px";
			break;
		case "3":
			clarity_text.innerHTML = "VS<sub>1</sub>/VS<sub>2</sub><br><br>Very Slight Inclusions";
			clarity_img.style.backgroundPosition = "0px -120px";
			break;	
		case "4":
			clarity_text.innerHTML = "SI<sub>1</sub>/SI<sub>2</sub><br><br>Slight Inclusions";
			clarity_img.style.backgroundPosition = "0px -180px";
			break;	
		case "5":
			clarity_text.innerHTML = "I<sub>1</sub>/I<sub>2</sub>/I<sub>3</sub><br><br>Imperfect";
			clarity_img.style.backgroundPosition = "0px -240px";
			break;	
	}
}

function getTab1() {
	tab1.style.backgroundColor = "#FFFFFF";
	tab2.style.backgroundColor = "#999999";
	cut_anatomy.style.visibility = "visible";
	cut_grading.style.visibility = "hidden";
}

function getTab2() {
	tab2.style.backgroundColor = "#FFFFFF";
	tab1.style.backgroundColor = "#999999";
	cut_grading.style.visibility = "visible";
	cut_anatomy.style.visibility = "hidden";
}

var cut_data1 = ["Excellent","57.5% to 63%","52% to 62%","31.5&deg; to 36.5&deg;","2.5% to 4.5%","12.5% to 17.0%","43%","45% to 65%","70% to 85%","Excellent to Very Good","5%-10% Premium"];
var cut_data2 = ["Very Good","56% to 64.5%","50% to 66%","26.5&deg; to 38.5&deg;","2.0% to 5.5%","10.5% to 18.0%","42% to 44%","40% to 70%","65% to 90%","Excellent to Good","No adjustment"];
var cut_data3 = ["Good","53.2% to 66.5%","47% to 69%","22&deg; to 40&deg;","0.0% to 7.5%","9.0% to 19.5%","41% to 46%","Any","Any","Excellent to Fair","-15% to 20%"];
var cut_data4 = ["Fair","51.1% to 70.2%","44% to 72% +","20.0&deg; to 41.5&deg;","0.0% to 10.5%","7.0% to 21.0%","< 40% or >  46%","Any","Any","Excellent to Fair","-20% to 40%"];
var cut_data5 = ["Poor","< 51.5% or > 70.2%","< 44% or > 72%","20.0&deg; to > 41.5&deg;","0.0% to 10.5%","< 7.0% or > 21.0%","< 40% or > 46%","Any","Any","Excellent to Poor","-45% to 60%"];

var cut_data_cell0 = document.getElementById('cut-data0');
var cut_data_cell1 = document.getElementById('cut-data1');
var cut_data_cell2 = document.getElementById('cut-data2');
var cut_data_cell3 = document.getElementById('cut-data3');
var cut_data_cell4 = document.getElementById('cut-data4');
var cut_data_cell5 = document.getElementById('cut-data5');
var cut_data_cell6 = document.getElementById('cut-data6');
var cut_data_cell7 = document.getElementById('cut-data7');
var cut_data_cell8 = document.getElementById('cut-data8');
var cut_data_cell9 = document.getElementById('cut-data9');
var cut_data_cell10 = document.getElementById('cut-data10');

var data_list = 1;

function getCutData(id) {
	var cut_data;
	switch (id) {
		case 1:
			cut_data = cut_data1;
			break;
		case 2:
			cut_data = cut_data2;
			break;
		case 3:
			cut_data = cut_data3;
			break;
		case 4:
			cut_data = cut_data4;
			break;
		case 5:
			cut_data = cut_data5;
			break;
	}
	cut_data_cell0.innerHTML = cut_data[0];
	cut_data_cell1.innerHTML = cut_data[1];
	cut_data_cell2.innerHTML = cut_data[2];
	cut_data_cell3.innerHTML = cut_data[3];
	cut_data_cell4.innerHTML = cut_data[4];
	cut_data_cell5.innerHTML = cut_data[5];
	cut_data_cell6.innerHTML = cut_data[6];
	cut_data_cell7.innerHTML = cut_data[7];
	cut_data_cell8.innerHTML = cut_data[8];
	cut_data_cell9.innerHTML = cut_data[9];
	cut_data_cell10.innerHTML = cut_data[10];
}

getCutData(1);

function nextData() {
	if (data_list < 5) {
		data_list++;	
	} else {
		data_list = 5;	
	}
	getCutData(data_list);
}

function prevData() {
	if (data_list > 1) {
		data_list--;	
	} else {
		data_list = 1
	}
	getCutData(data_list);
}


var brand_info = shopping.innerHTML;
function shopInfo(q) {
	
	switch (q) {
		case 0:
			shopping.innerHTML = brand_info;
			break;
		case 1:
			shopping.innerHTML = "<b>Cartier S.A.</b>, commonly known as \"Cartier\", is a French luxury jeweller and watch manufacturer. The corporation carries the name of the Cartier family of jewellers whose control ended in 1964 and who were known for numerous pieces including the \"Bestiary\" (best illustrated by the Panthère brooch of the 1940s created for Wallis Simpson), the diamond necklace created for Bhupinder Singh the Maharaja of Patiala and in 1904 the first practical wristwatch, the \"Santos.\" Cartier SA is headquartered in Paris.";
			shopping.innerHTML += "<div style='text-align:center'><a href='http://www.cartier.com/' target='_blank'>visit the website</a> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <a href='#' onclick='shopInfo(0)'>view other brand</a></div>";
			break;
		case 2:
			shopping.innerHTML = "<b>Tiffany & Co.</b> is an American jewellery and silverware company founded by Charles Lewis Tiffany and Teddy Young in New York City in 1837 as a \"stationery and fancy goods emporium.\" The store initially sold a wide variety of stationery items, and operated as Tiffany, Young and Ellis in lower Manhattan. The name was shortened to Tiffany & Co. in 1853 when Charles Tiffany took control, and the firm's emphasis on jewelry was established. Tiffany & Co. has since opened stores in major cities all over the world.";
			shopping.innerHTML += "<div style='text-align:center'><a href='http://www.tiffany.co.uk/' target='_blank'>visit the website</a> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <a href='#' onclick='shopInfo(0)'>view other brand</a></div>";
			break;
		case 3:
			shopping.innerHTML = "<b>Bulgari</b> is an Italian jeweler and luxury goods retailer. The trademark is usually written \"BVLGARI\" in ancient Roman style, and is derived from the surname of the company's Greek founder, Sotirio Boulgari (1857–1932). Although the company made a name for itself with jewelry, today it is a recognized luxury brand that markets several product lines including watches, handbags, fragrances, accessories, and hotels.";
			shopping.innerHTML += "<div style='text-align:center'><a href='http://www.bulgari.com/' target='_blank'>visit the website</a> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <a href='#' onclick='shopInfo(0)'>view other brand</a></div>";
			break;
		case 4:
			shopping.innerHTML = "<b>Van Cleef & Arpels</b> is a French jewellery, watch, and perfume company that was founded in 1896 by Salomon Arpels and Alfred Van Cleef. They opened their first boutique in 1906 at 22 place Vendôme, Paris. Van Cleef & Arpels are renowned for their expertise in precious stones and have won particular acclaim for a groundbreaking gem-setting procedure known as the Mystery Setting.";
			shopping.innerHTML += "<div style='text-align:center'><a href='http://www.vancleef-arpels.com/' target='_blank'>visit the website</a> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <a href='#' onclick='shopInfo(0)'>view other brand</a></div>";
			break;
		case 5:
			shopping.innerHTML = "<b>Harry Winston</b> (March 1, 1896 – December 28, 1978) was an American jeweler. He donated the Hope Diamondto the Smithsonian Institution in 1958 after owning it for a decade, and traded the Portuguese Diamond to the Smithsonian in 1963. Winston's jewelry empire began with his acquisition of Arabella Huntington's famous jewelry collection. The wife of railroad magnate Henry Huntington, Arabella amassed one of the world's most prestigious collections of jewelry, largely from Parisian jewelers such as Cartier.";
			shopping.innerHTML += "<div style='text-align:center'><a href='http://www.harrywinston.com/' target='_blank'>visit the website</a> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <a href='#' onclick='shopInfo(0)'>view other brand</a></div>";
			break;
		case 6:
			shopping.innerHTML = "<b>Derier</b>: Dignified and luxurious European origin, Zoran not meaningful group design, the group DERIER independence from Xian Shi-lun’s for one confirmed human legend, which attracted people. Derier's constant renewal of the spirit of the essence of heritage, in nearly a century old and abandoned, the more sonorous clarity. Between classic and contemporary, presented the most memorable trip to cross time and space art. ";
			shopping.innerHTML += "<div style='text-align:center'><a href='http://www.derier.com.cn/' target='_blank'>visit the website</a> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <a href='#' onclick='shopInfo(0)'>view other brand</a></div>";
			break;
		case 7:
			shopping.innerHTML = "<b>Damiani</b> is an Italian jewelry company founded in 1924 by Enrico Grassi Damiani in Valenza, Italy. Strongly influenced by the beauty of Art Deco styles, Enrico designed and produced fine jewelry which quickly became renowned. Damiani has become known the International Ambassador of Italian Excellence and winner of 18 Diamonds International Awards, the Damiani name is a mainstay with celebrities like Brad Pitt, Gwyneth Paltrow and Sharon Stone, taking its rightful place as a symbol of Hollywood glamour.";
			shopping.innerHTML += "<div style='text-align:center'><a href='http://www.damiani.com/' target='_blank'>visit the website</a> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <a href='#' onclick='shopInfo(0)'>view other brand</a></div>";
			break;
		case 8:
			shopping.innerHTML = "The House of <b>Boucheron</b> is French family dynasty founded by Frederic Boucheron in 1858. Four generations of the Boucheron family helped the brand become a worldwide leader in the High Jewelry market, expanding the brand to the four corners of the globe.";
			shopping.innerHTML += "<div style='text-align:center'><a href='https://www.boucheron.com/' target='_blank'>visit the website</a> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <a href='#' onclick='shopInfo(0)'>view other brand</a></div>";
			break;
		case 9:
			shopping.innerHTML = "<b>Swarovski company</b> was founded in 1895. The company established a crystal cutting factory in Wattens, Tyrol (Austria), to take advantage of local hydroelectricity for the energy-intensive grinding processes which Daniel Swarovski had patented. In 2004 Swarovski released Xilion, a new copyrighted cut designed to optimise the brilliance of Roses (crystal components with flat backs) and Chatons (diamond cut). It is a world famous jewellery seller.";
			shopping.innerHTML += "<div style='text-align:center'><a href='http://www.swarovski.com/' target='_blank'>visit the website</a> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <a href='#' onclick='shopInfo(0)'>view other brand</a></div>";
			break;
	}
}
