

function set_lights0() {
var dvi = $('smallphone1').getChildren();
	dvi[2].setStyle('background','url("../images/lights/l0.png") no-repeat center');
	dvi[3].setStyle('color','#adb2bf');
	
	var dvi = $('smallphone2').getChildren();
	dvi[2].setStyle('background','url("../images/lights/l0.png") no-repeat center');
	dvi[3].setStyle('color','#adb2bf');
	
	var dvi = $('smallphone3').getChildren();
	dvi[2].setStyle('background','url("../images/lights/l0.png") no-repeat center');
	dvi[3].setStyle('color','#adb2bf');
}

function getPhoneIMG() {
	//$('smallphone1').addEvent('',function(e){});
	
	if ($('smallphone1') && $('smallphone2') && $('smallphone3')) {
		var cursel = 0;
			$('smallphone1').addEvent('mouseover', function(e){
				var dvi = this.getChildren(); dvi[3].setStyle('color','#fff');
			});
			
			$('smallphone1').addEvent('mouseout', function(e){
					if (cursel != 1) {
						var dvi = this.getChildren(); dvi[3].setStyle('color','#adb2bf'); 
					}
			});
		
			$('smallphone2').addEvent('mouseover', function(e){
				var dvi = this.getChildren(); dvi[3].setStyle('color','#fff');
			});
			
			$('smallphone2').addEvent('mouseout', function(e){
					if (cursel != 2) {
						var dvi = this.getChildren(); dvi[3].setStyle('color','#adb2bf'); 
					}
			});	
		
			$('smallphone3').addEvent('mouseover', function(e){
				var dvi = this.getChildren(); dvi[3].setStyle('color','#fff');
			});
			
			$('smallphone3').addEvent('mouseout', function(e){
					if (cursel != 3) {
						var dvi = this.getChildren(); dvi[3].setStyle('color','#adb2bf'); 
					}
			});
			
			
			/* PUSH EVENTS */		
			$('smallphone1').addEvent('click', function(e){
				$('phone_selected').setProperty('value','1');
				var itarr = new Array();
				itarr = $$('div[class=example]');
				for (i=0;i<itarr.length;i++) {
					if (itarr[i].getCoordinates()['width']>272) {
						var site_selected = i;
					}
				}
				//$('mobile_iphone').setStyle("display","block");
				cursel = 1;
				set_lights0();
					var dvi = this.getChildren();
					dvi[2].setStyle('background','url(../images/lights/l1.png) no-repeat center');
					dvi[3].setStyle('color','#fff');
					
				$('MBLSKN').setStyle('background','url(../images/nphones/iphone.png) no-repeat center');
				$('MBLSKN').setStyle("width","244px"); $('MBLSKN').setStyle("height","451px");
				$('MBLSKN').setStyle('left','45px'); $('MBLSKN').setStyle('top','33px');
		
				var picture_path_id = 'picture_path_iphone'+site_selected;
				$('center_phone').set('html','<img src="'+$(picture_path_id).getProperty('value')+'" alt="" width="200px"  />');
				$('center_phone').setStyle('height','282px'); 
				$('center_phone').setStyle('margin-top','88px');
				//$('mobile_magic').setStyle("display","none");
				//$('mobile_palm').setStyle("display","none");
			});
			
			$('smallphone2').addEvent('click', function(e){
				$('phone_selected').setProperty('value','2');
				var itarr = new Array();
				itarr = $$('div[class=example]');
				for (i=0;i<itarr.length;i++) {
					if (itarr[i].getCoordinates()['width']>272) {
						var site_selected = i;
					}
				}
				//$('mobile_iphone').setStyle("display","block");
				cursel = 2;
				set_lights0();
					var dvi = this.getChildren();
					dvi[2].setStyle('background','url(../images/lights/l1.png) no-repeat center');
					dvi[3].setStyle('color','#fff');
					
				$('MBLSKN').setStyle('background','url(../images/nphones/magic.png) no-repeat center');
				$('MBLSKN').setStyle("width","244px"); $('MBLSKN').setStyle("height","488px");
				$('MBLSKN').setStyle('left','46px'); $('MBLSKN').setStyle('top','-5px');
				
				var picture_path_id = 'picture_path_magic'+site_selected;
				$('center_phone').set('html','<img src="'+$(picture_path_id).getProperty('value')+'" alt="" width="200px"  />');
				$('center_phone').setStyle('height','282px'); 
				$('center_phone').setStyle('margin-top','44px');
				
				//$('mobile_magic').setStyle("display","none");
				//$('mobile_palm').setStyle("display","none");
			});
			
			$('smallphone3').addEvent('click', function(e){
				var itarr = new Array();
				itarr = $$('div[class=example]');
				for (i=0;i<itarr.length;i++) {
				//	alert(itarr[i].getCoordinates()['width']);
					if (itarr[i].getCoordinates()['width']>272) {
						var site_selected = i;
					//	alert(itarr[i].getCoordinates()['width']);
					}
				}
				$('phone_selected').setProperty('value','3');
				//$('mobile_iphone').setStyle("display","block");
				cursel = 3;
				set_lights0();
					var dvi = this.getChildren();
					dvi[2].setStyle('background','url(../images/lights/l1.png) no-repeat center');
					dvi[3].setStyle('color','#fff');
					
				$('MBLSKN').setStyle('background','url(../images/nphones/palm.png) no-repeat center');
				$('MBLSKN').setStyle("width","244px"); $('MBLSKN').setStyle("height","488px");
				$('MBLSKN').setStyle('left','46px'); $('MBLSKN').setStyle('top','18px');
				
				var picture_path_id = 'picture_path_leo'+site_selected;
				$('center_phone').set('html','<img src="'+$(picture_path_id).getProperty('value')+'" alt="" width="200px"  />');
				$('center_phone').setStyle('height','283px'); 
				$('center_phone').setStyle('margin-top','83px');
				
				//$('mobile_magic').setStyle("display","none");
				//$('mobile_palm').setStyle("display","none");
			});
			
		
	}	
				
}
