// JavaScript Document

function clearit(remove, add) {
	$('#' + remove + '').remove();
	$('#' + add + '').append('<div id="' + remove + '"></div>');
}

// North America 

//$('#n_america').imagecoords();

function worldwide(){ 
	//$( "#worldwide" ).dialog({ position: 'center', resizable: false });
	$('#north_am').html('<img src="../../images/closebox.gif" onclick="clearit(\'north_am\', \'n_america\');"/><h3>Worldwide Laser Corp.</h3>Gilbert, Arizona<br/>480-850-9663').addClass('location');
	
	//<br/><br/><a href="http://www.wlsc.com">http://www.wlsc.com</a>
}

function lasertips(){ 
	//$( "#lasertips" ).dialog({ position: 'center', resizable: false });
	$('#north_am').html('<img src="../../images/closebox.gif" onclick="clearit(\'north_am\', \'n_america\');"/><h3>Lasertips, S.A. de C.V.</h3>Guadalajara, Mexico<br/>52 (33) 3826-4945').addClass('location');
	
	// <br/><br/><a href="http://www.lasertips.com.mx">http://www.lasertips.com.mx</a>
}

function world(){ 
	//$( "#world" ).dialog({ position: 'center', resizable: false });
	$('#north_am').html('<img src="../../images/closebox.gif" onclick="clearit(\'north_am\', \'n_america\');"/><h3>World Lasers</h3>Reading, Pennsylvania<br/>484-359-8906').addClass('location');
	
	// <br/><br/><a href="http://www.worldlasers.com">http://www.worldlasers.com</a>
}

function mississauga(){ 
	//$( "#mississauga" ).dialog({ position: 'center', resizable: false, width: '350px' });
	$('#north_am').html('<img src="../../images/closebox.gif" onclick="clearit(\'north_am\', \'n_america\');"/><h3>North American Laser Systems &ndash; Integrator</h3><br/>Mississauga, Canada<br/>905-542-3350').addClass('location');
	
	// <br/><br/><a href="http://www.northamericanlasers.com">http://www.northamericanlasers.com</a>
}

function automation(){ 
	//$( "#automation" ).dialog({ position: 'center', resizable: false });
	$('#north_am').html('<img src="../../images/closebox.gif" onclick="clearit(\'north_am\', \'n_america\');"/><h3>Automation Alternatives</h3>Toronto, Canada<br/>416-674-7511').addClass('location'); 
	
	// <br/><br/><a href="http://www.auto-alt.com">http://www.auto-alt.com</a>
}

function focusedlight(){ 
	//$( "#focusedlight" ).dialog({ position: 'center', resizable: false });
	$('#north_am').html('<img src="../../images/closebox.gif" onclick="clearit(\'north_am\', \'n_america\');"/><h3>Focused Light Engraving</h3>Longwood, Florida<br/>407-830-8885').addClass('location');
	
	//<br/><br/><a href="http://www.auto-alt.com">http://www.auto-alt.com</a>
}

function oem(){
	//$( "#oem" ).dialog({ position: 'center', resizable: false, width: '350px' });
	$('#north_am').html('<img src="../../images/closebox.gif" onclick="clearit(\'north_am\', \'n_america\');"/><h3>Universal Laser Systems (OEM Division)</h3><br/>Scottsdale, Arizona<br/>480-483-1214').addClass('location');
	
	//<br/><br/><a href="http://www.co2laser.com">http://www.co2laser.com</a>
}

// Europe



function sofia(){ 
	//$( "#sofia" ).dialog({ position: 'center', resizable: false });
	$('#eu').html('<img src="../../images/closebox.gif" onclick="clearit(\'eu\',\'euro\');"/><h3>Keit Ltd.</h3><h6>Bulgaria Sofia</h6>').addClass('location');
	
	//<br/><a href="http://www.keitbg.com">http://www.keitbg.com</a>
}

function grobenzell(){ 
	//$( "#grobenzell" ).dialog({ position: 'center', resizable: false });
	$('#eu').html('<img src="../../images/closebox.gif" onclick="clearit(\'eu\',\'euro\');"/><h3>NEXLASE GmbH</h3><h6>Gr&ouml;benzell &ndash; Deutschland<br/>49 (0)8142 65241 - 0</h6>').addClass('location');;
	
	//<br/><br/><a href="http://www.nexlase.com">http://www.nexlase.com</a>
}

function sodertalje(){ 
	//$( "#sodertalje" ).dialog({ position: 'center', resizable: false });
	$('#eu').html('<img src="../../images/closebox.gif" onclick="clearit(\'eu\',\'euro\');"/><h3>Azpect Photonics AB</h3><h6>Sodertalje, Sweden<br/>+46 8 55 44 24 89</h6>').addClass('location');
	
	//<br/><br/><a href="http://www.azpect.com">http://www.azpect.com</a>
}

function budapest(){
	//$( "#budapest" ).dialog({ position: 'center', resizable: false }); 
	$('#eu').html('<img src="../../images/closebox.gif" onclick="clearit(\'eu\',\'euro\');"/><h3>Quantum Lasertech Ltd.</h3><h6>Budapest, Hungary<br/>(+36-1) 430-0170</h6>').addClass('location');
	
	//<br/><br/><a href="http://www.lasersystems.com.hu">http://www.lasersystems.com.hu</a>
}

function krakow(){ 
	//$( "#krakow" ).dialog({ position: 'center', resizable: false });
	$('#eu').html('<img src="../../images/closebox.gif" onclick="clearit(\'eu\',\'euro\');"/><h3>DK Lasertechnik</h3<h6>Krak&#243;w, Polski<br/>(+36-1) 430-0170</h6>').addClass('location');
	
	//<br/><br/><a href="http://www.lasersystems.com.hu">http://www.lasersystems.com.hu</a>
}

function cranfield(){ 
	//$( "#cranfield" ).dialog({ position: 'center', resizable: false });
	$('#eu').html('<img src="../../images/closebox.gif" onclick="clearit(\'eu\',\'euro\');"/><h3>Pro-Lite Technologies <br/>Ltd.</h3><br/><h6>Cranfield, United Kingdom<br/>+44 (0)1234 436110</h6>').addClass('location');
	
	//<br/><br/><a href="http://www.pro-lite.co.uk">http://www.pro-lite.co.uk</a>
}

function alphen(){ 
	//$( "#alphen" ).dialog({ position: 'center', resizable: false });
	$('#eu').html('<img src="../../images/closebox.gif" onclick="clearit(\'eu\',\'euro\');"/><h3>BFi OPTiLAS</h3><h6>Alphen aan den Rijn<br/>+31 (0)172-44 60 60</h6>').addClass('location');
	
	//<br/><br/><a href="http://www.bfioptilas">http://www.bfioptilas</a>
}

function lisses(){ 
	//$( "#lisses" ).dialog({ position: 'center', resizable: false });
	$('#eu').html('<img src="../../images/closebox.gif" onclick="clearit(\'eu\',\'euro\');"/><h3>Acal BFi France S.A.S.</h3><h6>Lisses, France<br/>+33 (0)1 60 79 59 00</h6>').addClass('location');
	
	//<br/><br/><a href="http://www.bfioptilas">http://www.bfioptilas</a>
}

function dietzenbach(){ 
	//$( "#dietzenbach" ).dialog({ position: 'center', resizable: false });
	$('#eu').html('<img src="../../images/closebox.gif" onclick="clearit(\'eu\',\'euro\');"/><h3>Acal BFi Germany</h3><h6>Dietzenbach &ndash; Deutschland<br/>+49 (0) 8142 / 65 20 - 0</h6>').addClass('location');
	
	//<br/><br/><a href="http://www.bfioptilas">http://www.bfioptilas</a>
}

function milano(){ 
	//$( "#milano" ).dialog({ position: 'center', resizable: false });
	$('#eu').html('<img src="../../images/closebox.gif" onclick="clearit(\'eu\',\'euro\');"/><h3>Acal BFi Italy &ndash; Milan Headquarters</h3><br/>Assago, Italia').addClass('location');
	
	//<br/><br/><a href="http://www.bfioptilas">http://www.bfioptilas</a>
}

function roma(){ 
	//$( "#roma" ).dialog({ position: 'center', resizable: false });
	$('#eu').html('<img src="../../images/closebox.gif" onclick="clearit(\'eu\',\'euro\');"/><h3>Acal BFi Italy &ndash; Rome Office</h3><br/><h6>Roma, Italia</h6>').addClass('location');
	
	//<br/><br/><a href="http://www.bfioptilas">http://www.bfioptilas</a>
}

function madrid(){ 
	//$( "#madrid" ).dialog({ position: 'center', resizable: false });
	$('#eu').html('<img src="../../images/closebox.gif" onclick="clearit(\'eu\',\'euro\');"/><h3>Acal BFi Spain &ndash; Alcobendas Madrid</h3><br/><h6>Alcobendas, Espa&ntilde;a</h6>').addClass('location');
	
	//<br/><br/><a href="http://www.bfioptilas">http://www.bfioptilas</a>
}

function milton(){ 
	//$( "#milton" ).dialog({ position: 'center', resizable: false });
	$('#eu').html('<img src="../../images/closebox.gif" onclick="clearit(\'eu\',\'euro\');"/><h3>Acal BFi UK</h3><h6>Milton Keynes, United Kingdom</h6>').addClass('location');
	
	//<br/><br/><a href="http://www.bfioptilas">http://www.bfioptilas</a>
}

function uppsala(){
	//$( "#uppsala" ).dialog({ position: 'center', resizable: false }); 
	$('#eu').html('<img src="../../images/closebox.gif" onclick="clearit(\'eu\',\'euro\');"/><h3>Acal BFi Nordics</h3><h6>Uppsala, Sweden</h6>').addClass('location');
	
	//<br/><br/><a href="http://www.bfioptilas">http://www.bfioptilas</a>
}


function vienna(){ 
	//$( "#vienna" ).dialog({ position: 'center', resizable: false });
	$('#eu').html('<img src="../../images/closebox.gif" onclick="clearit(\'eu\',\'euro\');"/><h3>Univeral Laser Systems (OEM Division)</h3><br/><h6>Vienna, Austria<br/>+43 1 402 22 50</h6>').addClass('location');
	
	//<br/><br/><a href="http://www.ulsinc.at">http://www.ulsinc.at</a>
}

// Asia Pacific

//$('#asia').imagecoords();

function mumbai(){ 
	//$( "#mumbai" ).dialog({ position: 'center', resizable: false });
	$('#ap').html('<img src="../../images/closebox.gif" onclick="clearit(\'ap\',\'asia\');"/><h3>Unique Laser Engravers</h3><h6>Mumbai, India<br/>+91 22 2678 7772</h6>').addClass('location');
	
	//<br/><br/><a href="http://www.uniquelaser.net">http://www.uniquelaser.net</a>
}


function kowloon(){ 
	//$( "#kowloon" ).dialog({ position: 'center', resizable: false });
	$('#ap').html('<img src="../../images/closebox.gif" onclick="clearit(\'ap\',\'asia\');"/><h3>Optizone Technology Ltd.</h3><h6>Tong, Kowloon, Hong Kong<br/>(852) 2381 3112</h6>').addClass('location');
	
	//<br/><br/><a href="http://www.optizonetech.com">http://www.optizonetech.com</a>
}

function guangdong(){ 
	//$( "#guangdong" ).dialog({ position: 'center', resizable: false });
	$('#ap').html('<img src="../../images/closebox.gif" onclick="clearit(\'ap\',\'asia\');"/><h3>Optizone Technology (Shenzhen) Ltd.</h3><br/><h6>Guangdong Province, China<br/>(86-755) 2799 5459</h6>').addClass('location');
	
	//<br/><br/><a href="http://www.optizonetech.com">http://www.optizonetech.com</a>
}


function toyko(){ 
	//$( "#tokyo" ).dialog({ position: 'center', resizable: false });
	$('#ap').html('<img src="../../images/closebox.gif" onclick="clearit(\'ap\',\'asia\');"/><h3>Optoscience</h3><h6>Shinjuku-ku, Tokyo, Japan<br/>81-3-3356-1064</h6>').addClass('location');
	
	//<br/><br/><a href="http://www.optoscience.com">http://www.optoscience.com</a>
}

function nagano() {
	//$( "#nagano" ).dialog({ position: 'center', resizable: false });
	$('#ap').html('<img src="../../images/closebox.gif" onclick="clearit(\'ap\',\'asia\');"/><h3>Horiuchi Electronics<br/>Co. Ltd.</h3><br/><h6>Yagisawa Ueda-City, Nagano, Japan<br/>81-268-38-9291</h6>').addClass('location');
	
	//<br/><br/><a href="http://www.horiuchielectronics.co.jp/">http://www.horiuchielectronics.co.jp/</a>
}

function singapore() {
	//$( "#singapore" ).dialog({ position: 'center', resizable: false });
	$('#ap').html('<img src="../../images/closebox.gif" onclick="clearit(\'ap\',\'asia\');"/><h3>Sintec Optronics Pte Ltd.</h3><h6>Singapore, Thailand<br/>81-268-38-9291</h6>').addClass('location');
	
	//<br/><br/><a href="http://www.sintecoptronics.com">http://www.sintecoptronics.com/</a>
}

function daejon() {
	//$( "#daejon" ).dialog({ position: 'center', resizable: false });
	$('#ap').html('<img src="../../images/closebox.gif" onclick="clearit(\'ap\',\'asia\');"/><h3>SM Tech</h3><h6>Daejon, South Korea<br/>(+82)42-824-4413~4</h6>').addClass('location');
	
	//<br/><br/><a href="http://www.lasersystem.co.kr">http://www.lasersystem.co.kr</a>
}

function taipei() {
	//$( "#taipei" ).dialog({ position: 'center', resizable: false });
	$('#ap').html('<img src="../../images/closebox.gif" onclick="clearit(\'ap\',\'asia\');"/><h3>A Sun Photonics Co. Limited</h3><br/><h6>Taipei, Taiwan<br/>886-2-26327601</h6>').addClass('location');
	
	//<br/><br/><a href="http://asun.com.tw">http://www.asun.com.tw</a>
}

function wuhan() {
	//$( "#wuhan" ).dialog({ position: 'center', resizable: false });
	$('#ap').html('<img src="../../images/closebox.gif" onclick="clearit(\'ap\',\'asia\');"/><h3>Wuhan Sintec Optronics Co. Ltd.</h3><h6>Wuhan Hubei, China<br/>(+86 27) 51773381</h6>').addClass('location');
	
	//<br/><br/><a href="http://www.laserone.cn">http://www.laserone.cn</a>
}

function guangzhou() {
	//$( "#guangzhou" ).dialog({ position: 'center', resizable: false });
	$('#ap').html('<img src="../../images/closebox.gif" onclick="clearit(\'ap\',\'asia\');"/><h3>Ante Laser Co. Ltd.</h3><h6>Guangzhou, China<br/>(+86-20) 28395145</h6>').addClass('location'); 
	
	//<br/><br/><a href="http://www.antelaser.com.cn">http://www.antelaser.com.cn</a>
}

function yokohama() {
	//$( "#yokohama" ).dialog({ position: 'center', resizable: false, width: '400px' });
	$('#ap').html('<img src="../../images/closebox.gif" onclick="clearit(\'ap\',\'asia\');"/><h3>Universal Laser Systems (OEM Division)</h3><br/><h6>Yokohama, Japan<br/>+81 45-224-2270</h6>').addClass('location');
	
	//<br/><br/><a href="http://www.ulsinc.co.jp">http://www.ulsinc.co.jp</a>
}

function jiangsu() {
	//$( "#jiangsu" ).dialog({ position: 'center', resizable: false, width: '400px' });
	$('#ap').html('<img src="../../images/closebox.gif" onclick="clearit(\'ap\',\'asia\');"/><h3>Universal Laser Systems (OEM Division)</h3><h6>Yokohama, Japan<br/>+81 45-224-2270</h6>').addClass('location');
	
	//<br/><br/><a href="http://www.ulsinc.co.jp">http://www.ulsinc.co.jp</a>
}
function north() {
	$('#map').animate({ opacity: 0}, 'slow');
	$('#n_america').animate({ opacity: 1 }, 'slow').css('z-index', '3');
	$('#euro').animate({ opacity: 0 }, 'slow').css('z-index', '2');
	$('#asia').animate({ opacity: 0 }, 'slow').css('z-index', '1');
	$('#n_america').imagemap([
		{top_x: 208,top_y: 225,bottom_x: 268,bottom_y:284,callback: worldwide},
		{top_x: 270,top_y: 380,bottom_x: 330,bottom_y:440,callback: lasertips},
		{top_x: 460,top_y: 225,bottom_x: 520,bottom_y:285,callback: world},
		{top_x: 440,top_y: 205,bottom_x: 500,bottom_y:265,callback: mississauga},
		{top_x: 450,top_y: 195,bottom_x: 510,bottom_y:255,callback: automation},
		{top_x: 420,top_y: 330,bottom_x: 480,bottom_y:390,callback: focusedlight},
		{top_x: 205,top_y: 286,bottom_x: 217,bottom_y:293,callback: oem}
	]);
	$('#page-title h1').text('North American Representatives');
   
}

function eur() {
	$('#map').animate({ opacity: 0}, 'slow');
	$('#euro').animate({ opacity: 1 }, 'slow').css('z-index', '3');
	$('#n_america').animate({ opacity: 0 }, 'slow').css('z-index', '2');
	$('#asia').animate({ opacity: 0 }, 'slow').css('z-index', '1');
	$('#euro').imagemap([
		{top_x: 265,top_y: 225,bottom_x: 325,bottom_y:285,callback: sofia},
		{top_x: 194,top_y: 192,bottom_x: 205,bottom_y:196,callback: grobenzell},
		{top_x: 215,top_y: 108,bottom_x: 275,bottom_y:168,callback: sodertalje},
		{top_x: 234,top_y: 192,bottom_x: 249,bottom_y:204,callback: budapest},
		{top_x: 239,top_y: 166,bottom_x: 253,bottom_y:176,callback: krakow},
		{top_x: 132,top_y: 163,bottom_x: 141,bottom_y:200,callback: cranfield},
		{top_x: 156,top_y: 159,bottom_x: 177,bottom_y:178,callback: alphen},
		{top_x: 142,top_y: 196,bottom_x: 172,bottom_y:226,callback: lisses},
		{top_x: 180,top_y: 176,bottom_x: 191,bottom_y:185,callback: dietzenbach},
		{top_x: 169,top_y: 206,bottom_x: 187,bottom_y:220,callback: milano},
		{top_x: 191,top_y: 231,bottom_x: 210,bottom_y:245,callback: roma},
		{top_x: 106,top_y: 246,bottom_x: 136,bottom_y:296,callback: madrid},
		{top_x: 111,top_y: 159,bottom_x: 124,bottom_y:175,callback: milton},
		{top_x: 213,top_y: 87,bottom_x: 231,bottom_y:101,callback: uppsala},
		{top_x: 530,top_y: 376,bottom_x: 560,bottom_y:406,callback: mumbai},
		{top_x: 217,top_y: 197,bottom_x: 229,bottom_y:206,callback: vienna}
	]);
	
	$('#page-title h1').text('European and African Representatives');
}


function aspac() {
	$('#map').animate({ opacity: 0}, 'slow').css('z-index', '0');
	$('#euro').animate({ opacity: 0 }, 'slow').css('z-index', '1');
	$('#n_america').animate({ opacity: 0 }, 'slow').css('z-index', '2');
	$('#asia').animate({ opacity: 1 }, 'slow').css('z-index', '1000');
	$('#asia').imagemap([
		{top_x: 159,top_y: 329,bottom_x: 171,bottom_y:342,callback: mumbai},
		{top_x: 372,top_y: 302,bottom_x: 387,bottom_y:312,callback: kowloon},
		{top_x: 376,top_y: 281,bottom_x: 390,bottom_y:290,callback: guangdong},
		{top_x: 527,top_y: 235,bottom_x: 544,bottom_y:244,callback: toyko},
		{top_x: 514,top_y: 212,bottom_x: 532,bottom_y:222,callback: nagano},
		{top_x: 324,top_y: 420,bottom_x: 343,bottom_y:434,callback: singapore},
		{top_x: 445,top_y: 224,bottom_x: 463,bottom_y:248,callback: daejon},
		{top_x: 421,top_y: 292,bottom_x: 438,bottom_y:305,callback: taipei},
		{top_x: 400,top_y: 260,bottom_x: 417,bottom_y:274,callback: wuhan},
		{top_x: 390,top_y: 300,bottom_x: 408,bottom_y:309,callback: guangzhou},
		{top_x: 500,top_y: 232,bottom_x: 523,bottom_y:249,callback: yokohama},
		{top_x: 421,top_y: 270,bottom_x: 432,bottom_y:279,callback: jiangsu}
	]);
	
	$('#page-title h1').text('Asia and South Pacific Representatives');
}


$(function(){
	//$('#map').imagecoords();
	$('#map').css('z-index', '3');
	$('#n_america').css({ opacity: 0 });
	$('#euro').css({ opacity: 0 });
	$('#asia').css({ opacity: 0 });

	$('#map').imagemap([
		{top_x: 1,top_y: 2,bottom_x: 290,bottom_y:380,callback: north},
		{top_x: 275,top_y: 2,bottom_x: 470,bottom_y:380,callback: eur},
		{top_x: 460,top_y: 2,bottom_x: 701,bottom_y:380,callback: aspac}
	]);
		
	
	$('#north_america').click(north);
	$('#eurafrica').click(eur);
	$('#asiapacific').click(aspac);

});


