/* <![CDATA[ */
var linkIndex = 1;
var url = location.href;
var isPlay = false;
var _result1 = url.search('dresses.php');
var _result2 = url.search('bridal.php');
var _result3 = url.search('lbd.php');
var _result4 = url.search('suits.php');
var _result5 = url.search('coats.php');
var _result6 = url.search('atelier.php');
var _result7 = url.search('aboutus.php');
var _result8 = url.search('contactus.php');
var _result9 = url.search('map.php');


var directionKeyNav = {
	init:function(){
		if (_result1 > -1){
			document.getElementById('link1').focus();
			document.getElementById('link1').className = 'text_style_3';

			document.getElementById('td1').style.background = "none";
			document.getElementById('td1').style.backgroundImage = "url('images/brush.jpg')";
			
			document.getElementById('td1').style.backgroundRepeat = "no-repeat";
			document.getElementById('td1').style.backgroundPosition = "bottom center";
			linkIndex = 1;
		}
		if (_result2 > -1){
			document.getElementById('link2').focus();
			document.getElementById('link2').className = 'text_style_3';

			document.getElementById('td2').style.background = "none";

			document.getElementById('td2').style.backgroundImage = "url('images/brush.jpg')";
			document.getElementById('td2').style.backgroundRepeat = "no-repeat";
			document.getElementById('td2').style.backgroundPosition = "bottom center";
			linkIndex = 2;
		}
		if (_result3 > -1){
			document.getElementById('link3').focus();
			document.getElementById('link3').className = 'text_style_3';

			document.getElementById('td3').style.background = "none";

			document.getElementById('td3').style.backgroundImage = "url('images/brush.jpg')";
			document.getElementById('td3').style.backgroundRepeat = "no-repeat";
			document.getElementById('td3').style.backgroundPosition = "bottom center";
			linkIndex = 3;
		}
		if (_result4 > -1){
			document.getElementById('link4').focus();
			document.getElementById('link4').className = 'text_style_3';

			document.getElementById('td4').style.background = "none";

			document.getElementById('td4').style.backgroundImage = "url('images/brush.jpg')";
			document.getElementById('td4').style.backgroundRepeat = "no-repeat";
			document.getElementById('td4').style.backgroundPosition = "bottom center";
			linkIndex = 4;
		}
		if (_result5 > -1){
			document.getElementById('link5').focus();
			document.getElementById('link5').className = 'text_style_3';

			document.getElementById('td5').style.background = "none";

			document.getElementById('td5').style.backgroundImage = "url('images/brush.jpg')";
			document.getElementById('td5').style.backgroundRepeat = "no-repeat";
			document.getElementById('td5').style.backgroundPosition = "bottom center";
			linkIndex = 5;
		}
		if (_result6 > -1){
			document.getElementById('link6').focus();
			document.getElementById('link6').className = 'text_style_3';

			document.getElementById('td6').style.background = "none";

			document.getElementById('td6').style.backgroundImage = "url('images/Darkbrush2.jpg')";
			document.getElementById('td6').style.backgroundRepeat = "no-repeat";
			document.getElementById('td6').style.backgroundPosition = "bottom center";
			linkIndex = 6;
		}
		if (_result7 > -1){
			document.getElementById('link7').focus();
			document.getElementById('link7').className = 'text_style_3';

			document.getElementById('td7').style.background = "none";

			document.getElementById('td7').style.backgroundImage = "url('images/Darkbrush2.jpg')";
			document.getElementById('td7').style.backgroundRepeat = "no-repeat";
			document.getElementById('td7').style.backgroundPosition = "bottom center";
			linkIndex = 7;
		}
		if (_result8 > -1){
			document.getElementById('link8').focus();
			document.getElementById('link8').className = 'text_style_3';

			document.getElementById('td8').style.background = "none";

			document.getElementById('td8').style.backgroundImage = "url('images/Darkbrush2.jpg')";
			document.getElementById('td8').style.backgroundRepeat = "no-repeat";
			document.getElementById('td8').style.backgroundPosition = "bottom center";
			linkIndex = 8;
		}
		if (_result9 > -1){
			document.getElementById('link9').focus();
			document.getElementById('link9').className = 'text_style_3';

			document.getElementById('td9').style.background = "none";

			document.getElementById('td9').style.backgroundImage = "url('images/Darkbrush2.jpg')";
			document.getElementById('td9').style.backgroundRepeat = "no-repeat";
			document.getElementById('td9').style.backgroundPosition = "bottom center";
			linkIndex = 9;
		}
		if(!document.getElementById) return;
		document.onkeyup = directionKeyNav.handler;
	},
	
	handler:function(e){
		e=e||window.event;
		var el=e.target||e.srcElement;
		if(!el || !el.nodeName || !/input|select|textarea/i.test(el.nodeName)){
			var key = e.which||e.charCode||e.keyCode;
			var linkURL = 'link';
			var previousLinkURL = 'link';
			var style_class;
			if((_result7 > -1) || 
			   (_result8 > -1) || 
			   (_result9 > -1)){
				   style_class = 'text_style_4';
			}
			else{
				style_class = 'text_style_4';
			}
			switch(key) {
				/*
				case 37: // left arrow key
					previousLinkURL = previousLinkURL + linkIndex;
					if (linkIndex > 1)
						linkIndex --;
					linkURL = linkURL + linkIndex;
					//alert(linkIndex);
					document.getElementById(linkURL).focus();
					if (linkIndex >= 5){
						document.getElementById(previousLinkURL).className = style_class;
						document.getElementById(linkURL).className = 'text_style_3';
					}
					else{
						document.getElementById(previousLinkURL).className = 'text_style_2';
						document.getElementById(linkURL).className = 'text_style_3';
					}
					//location.href = document.getElementById('link_prev').href;
				break;
				case 39: // right arrow key
					previousLinkURL = previousLinkURL + linkIndex;
					if (linkIndex < 9)
					linkIndex ++;
					linkURL = linkURL + linkIndex;
					//alert(linkIndex);
					document.getElementById(linkURL).focus();
					if (linkIndex <= 6){
						document.getElementById(previousLinkURL).className = 'text_style_2';
						document.getElementById(linkURL).className = 'text_style_3';
					}
					else{
						document.getElementById(previousLinkURL).className = style_class;
						document.getElementById(linkURL).className = 'text_style_3';
					}
					//location.href = document.getElementById('link_next').href;
				break;
				*/
				case 32:
					//if (_result7 > -1 || _result8 > -1 || _result6 > -1){
					if (isPlay){
						isPlay = false;
						//document.getElementById("player").src='images/icons/play.png';
						show.stop();
					}
					else{
						if (_result7 > -1 || _result8 > -1 || _result6 > -1 || _result9 > -1){
							isPlay = false;
							show.stop();
						}else{
							isPlay = true;
							//document.getElementById("player").src='images/icons/pause.png';
							show.play();
						}
					}
				break;
			}
		}
	},
	resetLinkIndex:function(__index){
		linkIndex = __index;
	}
}


window.onload = function(){
  directionKeyNav.init();
}
/* ]]> */