function window_onload()
{
	getImage();
}

function window_onunload()
{
	if (popupWinPointer != null && !popupWinPointer.closed)
	{
		popupWinPointer.close();
	}
}

function getImage()
{
	if (screen.width == 800)
	{
		document.all.mapImg.src = "images/map800.jpg";
		document.all.mapImg.useMap = "#map800";
	}
	else
	{
		document.all.mapImg.src = "images/map1024.jpg";	
		document.all.mapImg.useMap = "#map1024";
	}
}

// object to be used by the popupwindow
//var popupTitle = "";
var popupImagesNum = 0;
var popupImagesSrcs = new Array();
var popupImagesNames = new Array()
var popupImagesDetails = new Array();
var popupImagesTitles = new Array();
var curPopupNum = 0;
var imageNum = 0;

var popupSize = "small";
var popupWinPointer = null;

function openStoneDetailsSwitch(popupNum)
{
	imageNum = 0;
	
	curPopupNum = popupNum;
	
	switch (popupNum)
	{
		case 1:	//Ramon Grey									
			addImage("polished_small.jpg", "Polished", "<b>Commercial Name</b><br>Jerusalem Grey<br>Desert Beige<br>Jerusalem Beige<br><b>Source</b><br>Mitzpe Ramon<br><b>Density</b><br>2660kg/m3<br><b>Absorption</b><br>0.5%<br><b>Compressive strength</b><br>10.45 MPA", "Ramon Grey");
			addImage("bush_small.jpg", "Bush Hammered<br>&quot;Mutabe&quot;");
			addImage("fine_small.jpg", "Fine chiseled<br>&quot;Musamsam&quot;");
			addImage("rough_small.jpg", "Rough chiseled<br>&quot;Taltish&quot;");
			addImage("","&nbsp;","","");									
			break;
		
		case 2: //Ramon Yellow							
			addImage("1medium_polished_small.jpg", "Medium Polished", "<b>Commercial Name</b><br>Jerusalem Gold Medium,<br>Jerusalem Gold, Desert Gold,<br>Ramon Yellow #2, Nakab Gold <br><b>Source</b><br>Mitzpe Ramon<br><b>Density</b><br>2660kg/m3<br><b>Absorption</b><br>0.6%<br><b>Compressive strength</b><br>11.6 MPA", "Ramon Yellow Medium");
			addImage("2bush_small.jpg", "Bush Hammered<br>&quot;Mutabe&quot;", "<b>Commercial Name</b><br>Jerusalem Gold Medium,<br>Jerusalem Gold, Desert Gold,<br>Ramon Yellow #2, Nakab Gold <br><b>Source</b><br>Mitzpe Ramon<br><b>Density</b><br>2660kg/m3<br><b>Absorption</b><br>0.6%<br><b>Compressive strength</b><br>11.6 MPA", "Ramon Yellow Medium");
			addImage("3fine_small.jpg", "Fine chiseled<br>&quot;Musamsam&quot;", "<b>Commercial Name</b><br>Jerusalem Gold Medium,<br>Jerusalem Gold, Desert Gold,<br>Ramon Yellow #2, Nakab Gold <br><b>Source</b><br>Mitzpe Ramon<br><b>Density</b><br>2660kg/m3<br><b>Absorption</b><br>0.6%<br><b>Compressive strength</b><br>11.6 MPA", "Ramon Yellow Medium");
			addImage("4split_small.jpg", "Split<br>&quot;Tubze&quot;", "<b>Commercial Name</b><br>Jerusalem Gold Medium,<br>Jerusalem Gold, Desert Gold,<br>Ramon Yellow #2, Nakab Gold <br><b>Source</b><br>Mitzpe Ramon<br><b>Density</b><br>2660kg/m3<br><b>Absorption</b><br>0.6%<br><b>Compressive strength</b><br>11.6 MPA", "Ramon Yellow Medium");
			addImage("","&nbsp;","","");
			addImage("5ryl_polished_small.jpg", "Ramon Yellow Light - <br>Polished", "<b>Commercial Name</b><br>Ramon Pearl, Ramon Yellow #1,<br>Jerusalem Gold Light,<br>Jerusalem Gold, Desert Gold,<br>Nakab Gold<br><b>Source</b><br>Mitzpe Ramon<br><b>Density</b><br>2660kg/m3<br><b>Absorption</b><br>0.6%<br><b>Compressive strength</b><br>11.6 MPA", "Ramon Yellow Light");
			addImage("6ryd_polished_small.jpg", "Ramon Yellow Dark - <br>Polished", "<b>Commercial Name</b><br>Jerusalem Gold Dark,<br>Desert Gold, Ramon Yellow #3,<br>Jerusalem Gold, Nakab Gold<br><b>Source</b><br>Mitzpe Ramon<br><b>Density</b><br>2660kg/m3<br><b>Absorption</b><br>0.6%<br><b>Compressive strength</b><br>11.6 MPA", "Ramon Yellow Dark");
			addImage("","&nbsp;","","");
			addImage("","&nbsp;","","");
			addImage("","&nbsp;","","");
			break;
			
		case 3: //Ramon White			
			addImage("1rw_polished_small.jpg", "Polished", "<b>Commercial Name</b><br>Jerusalem Cream<br><b>Density</b><br>2617kg/m3<br><b>Absorption</b><br>0.9%<br><b>Compressive strength</b><br>11.6 MPA", "Ramon White");
			addImage("2rw_polished_small.jpg", "Polished");
			addImage("","&nbsp;","","");
			addImage("","&nbsp;","","");
			addImage("","&nbsp;","","");		
			break;
			
		case 4: //Hebron						
			addImage("1hc_polished_small.jpg", "Hebron Cream - <br>Polished", "<b>Commercial Name</b><br>Yatta Yellow, Jerusalem Yellow,<br>Shyuch,Injasa<br><b>Density</b><br>2609kg/m3<br><b>Absorption</b><br>1.2%<br><b>Compressive strength</b><br>9.9 MPA", "Hebron Cream");
			addImage("2hw_fine_small.jpg", "Hebron White - <br>Fine Chiseled<br>&quot;Musamsam&quot; ", "<b>Commercial Name</b><br>Jerusalem Cream,Yata,<br>Shyuch,Injasa<br><b>Density</b><br>2656kg/m3<br><b>Absorption</b><br>0.5%<br><b>Compressive strength</b><br>11.9 MPA", "Hebron White (with red veins)");
			addImage("3hp_polished_small.jpg", "Hebron Pink - <br>Polished", "<b>Commercial Name</b><br>Jerusalem Pink, Yatta Pink,<br>Zahari<br><b>Density</b><br>2625kg/m3<br><b>Absorption</b><br>1.0%<br><b>Compressive strength</b><br>10.9 MPA", "Hebron Pink");
			addImage("","&nbsp;","","");
			addImage("","&nbsp;","","");			
			break;
			
		case 5: //Halila			
			addImage("halila_polished_small.jpg", "Polished", "<b>Commercial Name</b><br>Antique Gold,<br>Jerusalem Antique Gold,<br>Tufach, Galil-Gold<br><b>Density</b><br>2532kg/m3<br><b>Absorption</b><br>1.5%<br><b>Compressive strength</b><br>12.2 MPA", "Halila");
			addImage("","&nbsp;","","");
			addImage("","&nbsp;","","");
			addImage("","&nbsp;","","");
			addImage("","&nbsp;","","");			
			break;
			
		case 6: //Jerusalem Red						
			addImage("1jr_honed_small.jpg", "Honed", "<b>Commercial Name</b><br>Slaib, Gilo, Mizi-Yahudi<br><b>Density</b><br>2775kg/m3<br><b>Absorption</b><br>0.4%", "Jerusalem Red");
			addImage("2jr_fine_small.jpg", "Fine Chiseled<br>&quot;Musamsam&quot;");
			addImage("","&nbsp;","","");
			addImage("","&nbsp;","","");
			addImage("","&nbsp;","","");
			break;
		
		case 7:	//Canaan							
			addImage("1cg_polished_small.jpg", "Canaan Gold - <br>Polished", "<b>Commercial Name</b><br>Cufer Maleik<br><b>Density</b><br>2630kg/m3<br><b>Absorption</b><br>0.7%", "Canaan Gold");
			addImage("2cp_polished_small.jpg", "Canaan Pink - <br>Polished", "<b>Commercial Name</b><br>Malake<br><b>Density</b><br>2640kg/m3<br><b>Absorption</b><br>0.6%", "Canaan Pink");
			addImage("","&nbsp;","","");
			addImage("","&nbsp;","","");
			addImage("","&nbsp;","","");
			break;
			
		case 8: //Modiin
			addImage("1modiin_small.jpg", "modiin 1", "<b>Commercial Name</b><br>Azmon<br><b>Density</b><br>2662kg/m3<br><b>Absorption</b><br>0.57%<b><br>Compressive strength</b><br>12.94 MPA", "Modiin");
			addImage("2modiin_small.jpg", "modiin 2");
			addImage("3modiin_small.jpg", "modiin 3");				
			addImage("","&nbsp;","","");
			addImage("","&nbsp;","","");			
			break;
			
		case 9: //Bir-Zeit Grey			
			addImage("1bzg_pholished_small.jpg", "Polished", "<b>Commercial Name</b><br>Benjamin Grey<br><b>Density</b><br>2675kg/m3<br><b>Absorption</b><br>0.7%<br><b>Compressive strength</b><br>10.5 MPA", "Bir-Zeit Grey");
			addImage("2bzg_musamsam_small.jpg", "&quot;Musamsam&quot;<br>Fine Chiseled");
			addImage("3bzg_mutaba_small.jpg", "&quot;Mutabe&quot;<br>Bush Hammered");			
			addImage("4bzg_taltish_small.jpg", "&quot;Taltish&quot;<br>Rough chiseled");
			addImage("5bzg_tubza_small.jpg", "&quot;Tubze&quot;<br>Split");			
			break;
			
		case 10: //Bir-Zeit Yellow			
			addImage("1bzy_fine_small.jpg", "Fine Chiseled<br>&quot;Musamsam&quot;", "<b>Commercial Name</b><br>Benjamin Gold<br><b>Density</b><br>2652kg/m3<br><b>Absorption</b><br>0.7%<br><b>Compressive strength</b><br>10.8 MPA", "Bir-Zeit Yellow");
			addImage("2bzy_rough_small.jpg", "Rough chiseled<br>&quot;Taltish&quot;");
			addImage("3bzy_split_small.jpg", "Split<br>&quot;Tubze&quot;");	
			addImage("","&nbsp;","","");
			addImage("","&nbsp;","","");			
			break;
			
		case 11: //Nazareth			
			addImage("1polished_small.jpg", "Polished", "<b>Commercial Name</b><br>Peki'in<br><b>Density</b><br>2737kg/m3<br><b>Absorption</b><br>1.0%<br><b>Compressive strength</b><br>8.2 MPA <br><b>Abrasion</b><br>1.15mm", "Nazareth");
			addImage("2polished_small.jpg", "Polished");
			addImage("","&nbsp;","","");
			addImage("","&nbsp;","","");
			addImage("","&nbsp;","","");
			break;
			
		case 12: //Ivory of Galilee			
			addImage("1ivory_flamed_small.jpg", "Ivory Flamed", "<b>Source</b><br>Yiftah Quarry<br><b>Density</b><br>2677kg/m3<br><b>Absorption</b><br>0.5%<br><b>Compressive strength</b><br>10.1 MPA <br><b>Abrasion</b><br>2.53mm", "Ivory of Galilee");
			addImage("2ivory_honed_small.jpg", "Ivory Honed");
			addImage("","&nbsp;","","");
			addImage("","&nbsp;","","");
			addImage("","&nbsp;","","");
			break;
			
		case 13: //Rose of Galilee			
			addImage("1rose902_small.jpg", "Rose 902<br>Flamed", "<b>Commercial Name</b><br>Rose 902<br><b>Source</b><br>Yiftah Quarry<br><b>Density</b><br>2640kg/m3<br><b>Absorption</b><br>1.45%<br><b>Abrasion</b><br>1.52mm", "Rose of Galilee");
			addImage("2rose908_small.jpg", "Rose 908<br>Polished", "<b>Commercial Name</b><br>Rose 908<br><b>Source</b><br>Yiftah Quarry<br><b>Density</b><br>2625kg/m3<br><b>Absorption</b><br>1.7%<br><b>Abrasion</b><br>1.23mm");		
			addImage("","&nbsp;","","");
			addImage("","&nbsp;","","");
			addImage("","&nbsp;","","");
			break;
			
		case 14: //Honey of Galilee			
			addImage("1honey_flamed_small.jpg", "Honey Flamed", "<b>Source</b><br>Yiftah Quarry<br><b>Density</b><br>2676kg/m3<br><b>Absorption</b><br>0.3%<br><b>Abrasion</b><br>1.24mm", "Honey of Galilee");
			addImage("2honey_polished_small.jpg", "Honey Polished");
			addImage("","&nbsp;","","");
			addImage("","&nbsp;","","");
			addImage("","&nbsp;","","");
			break;
			
		case 15: //Caesar Stone			
			var details15 = "<table><tr><td colspan='2' class='regText'><b>Product Description:</b></td></tr>";
			details15 += "<tr><td class='regText' valign='top'>Brand Name:<br>Description:<br>Appearance:<br><br>Finish:<br>Size:</td>";
			details15 += "<td class='regText' valign='top'>Ceasarstone<br>Engineered stone<br>In 50 different<br>colors and structures<br>Polished<br>Slabs 122&quot;x53&quot;<br>(300x135 cm)<br>Thicknesses<br>1/2&quot;-3/4&quot;-1.25&quot;<br>(1.3-2.3 cm)</td></tr>";
			details15 += "<tr><td colspan='2' class='regText'><br><b>Physical Properties:</b></td></tr></table>";
			details15 += "<table><tr><td class='regText' valign='top'>(caesarstone 3000)<br>Flextual strength:<br><br>Mohs Hardness:<br>Water absorption:</td>";
			details15 += "<td class='regText' valign='top'><br>7,420 PSI<br>(650kg/cm2)<br>6.5-7.5<br>0.02%</td></tr>";
			details15 += "</table>"
			addImage("1cs9350_small.jpg", "Ceasar Stone<br>9350", details15, "Caesar Stone");
			addImage("2cs3470_small.jpg", "Ceasar Stone<br>3470");
			addImage("3cs9100_small.jpg", "Ceasar Stone<br>9100");
			addImage("4cs2510_small.jpg", "Ceasar Stone<br>2510");
			addImage("5cs2200_small.jpg", "Ceasar Stone<br>2200");
			break;
			
		case 16: //Orpal Stone			
			addImage("1Ilan5100_small.jpg", "Ilan 5100", "<b>Attrition Test</b><br>MOHS 6-7<br><b>Pressing Strength after 25 Cycles</b><br>2082<br><b>Water Absorption:</b><br>0.020%<br><b>Blow Test</b><br>135cm<br><b>Bending Strength</b><br>650 kg/m3<br><b>Pressing Strength</b><br>2200kg/m3", "Orpal Stone");
			addImage("2petel5101_small.jpg", "Petel 5101");
			addImage("3vered5102_small.jpg", "Vered 5102");
			addImage("4alon5103_small.jpg", "Alon 5103");
			addImage("5yasmin5300_small.jpg", "Yasmin 5300");
			addImage("6egoz5302_small.jpg", "Egoz 5302");
			addImage("7ardas5303_small.jpg", "Ardas 5303");
			addImage("8harzit5307_small.jpg", "Harzit 5307");
			addImage("9zivoni5311_small.jpg", "Zivoni 5311");
			addImage("10geranum5314_small.jpg", "Geranum 5314");
			break;
			
		default:
			return;
			break;				
	}	
	
	//setting the number of images in the current popup:
	popupImagesNum = imageNum;
	
	if (popupWinPointer != null && !popupWinPointer.closed)
	{	
		if (popupImagesNum <= 5 && popupSize == "large")
		{
			popupWinPointer.close();
			popupWinPointer = openWin("StoneDetails.html",580,480);
			popupSize = "small";
		}
		else if(popupImagesNum > 5 && popupSize == "small")
		{
			popupWinPointer.close();
			popupWinPointer = openWin("StoneDetails.html",580,576);
			popupSize = "large";
		}
		else
		{
			popupWinPointer.location.reload();
			popupWinPointer.focus();
		}
	}
	else
	{	
		if (popupImagesNum <= 5)
		{
			popupWinPointer = openWin("StoneDetails.html",580,480);
			popupSize = "small";
		}
		else
		{
			popupWinPointer = openWin("StoneDetails.html",580,576);
			popupSize = "large";
		}
	}
	
}

function addImage(src, name, details, title)
{	
	if (src != "")
		popupImagesSrcs[imageNum] = "images//StoneIndex//" + curPopupNum + "//" + src;
	else
		popupImagesSrcs[imageNum] = "";
	popupImagesNames[imageNum] = name;
	popupImagesDetails[imageNum] = details;
	popupImagesTitles[imageNum] = title;
	imageNum++;
}
