function show_hide_address2(){
	
	if (document.getElementById('checkbox').checked==true){
	document.getElementById('address2').style.display='block';
	}
	else {	
	document.getElementById('address2').style.display='none';}
}
//////////////////////////////////////////////
function confirm_step2(){
	
	if (document.getElementById('checkbox').checked==true){
	var new_name=document.form2.new_name.value;
	var new_email=document.form2.new_email.value;
	var new_street=document.form2.new_street.value;	
	var new_city=document.form2.new_city.value;
	var new_zip=document.form2.new_zip.value;
	var new_phone=document.form2.new_phone.value;
	
		if (new_name.length<5 || new_name.length>50 || new_name.length=='ΟΝΟΜΑΤΕΠΩΝΥΜΟ'){
			alert ('no');
			return false;
		}
	}

}
//////////////////////////////////////////////
      <!--
      function isNumberKey(evt)
      {
         var charCode = (evt.which) ? evt.which : event.keyCode
         if (charCode > 31 && (charCode < 48 || charCode > 57))
            return false;

         return true;
      }
      //-->


function clearText(obj){
		if (obj.defaultValue == obj.value) {
			obj.value = '';
			obj.className = 'click';
		} else if (obj.value == '') {
			obj.value = obj.defaultValue;
			obj.className = 'blur';
		}
	}

	function handleclick(obj){
		if ($(obj).attr('href') == 'javascript:void(0);' || $(obj).attr('href') == 'javascript:;') {
			//ignore
		} else if ($(obj).hasClass('zoom1') || $(obj).attr('id') == 'fancybox-close') {
			//ignore fancybox links
		} else if ($(obj).hasClass('language')) {
			var currenturl = window.location.href;

			if (currenturl.indexOf('/en/') != -1){
				currenturl = currenturl.replace(/\/en\//, '/el/');
			} else if (currenturl.indexOf('/el/') != -1) {
				currenturl = currenturl.replace(/\/el\//, '/en/');
			} 

			window.location = currenturl;
		} else if ($(obj).attr('target') != '_blank') {
			document.body.style.cursor = 'wait';
			document.title = $(obj).attr('title');
			
			url = $(obj).attr('href');
			url = url.replace(/http:\/\/www.oikos.gr\/el\//, '');
			url = url.replace(/http:\/\/www.oikos.gr\/en\//, '');
			
//			$("#ajaxcontent").load($(obj).attr('href'));
			$("#ajaxcontent").load(url);
			
			if ($(obj).parents().is("#ajaxcontent") || $(obj).parents().is("#footer")) {	
				$('html,body').animate({scrollTop: $("#ajaxcontent").offset().top}, 750);
			}
			
			
			document.body.style.cursor = 'default';
			_gaq.push(['_trackPageview', $(obj).attr('href')]);
			window.location.href = '#' + url;
		} else {
			window.open($(obj).attr('href'));
		}
	}

	var formoptions = {
		target:     '#ajaxcontent'
	};

	function hadnleform(obj) {
		$(obj).ajaxForm(formoptions);
	}

	//var zimage;
	function swappic(imgsrc){
		var img = new Image();
		$(img).load(function () {
			$("#datailimg").attr("src", imgsrc);
			//alert(zimage.data("dim").width + "|" + $(this).attr('width'));
	//		zimage.data("dim").width = $(this).attr('width');
	//		zimage.data("dim").height = $(this).attr('height');

//			zimage.move();
//			zimage.manualzoom(0);
//			zimage.resize();
	        }).attr('src', imgsrc);
	}

	function HighlightDetails () {
		this.name = '';
		this.url = '';
		this.title = '';
	}

	var Highlights = [];

	function createHighlights() {
		$('#highlights a').each(
			function(e){
				if ($(this).attr('id').indexOf('hlimg') != -1) {
					hlposition = $(this).attr('id').replace('hlimg', '');
					hlposition = parseInt(hlposition);

					Highlights[hlposition] = new HighlightDetails;

					Highlights[hlposition].name = $(this).attr('rel');
					Highlights[hlposition].title = $(this).attr('title');

					//Temp workaround for IE 6 + 7
					url = $(this).attr('href');
//					url = url.replace(/http:\/\/192.168.1.200\/oikos\/latest\//, '');
//					url = url.replace(/http:\/\/localhost\/GRAPTIS\/oikos\/el\//, '');
//					url = url.replace(/http:\/\/localhost\/GRAPTIS\/oikos\/en\//, '');
					url = url.replace(/http:\/\/www.oikos.gr\/el\//, '');
					url = url.replace(/http:\/\/www.oikos.gr\/en\//, '');

					Highlights[hlposition].url = url;

					$(this).bind("click", function(){
						showHighlightInfo(this);
					});

					$(this).attr('title', '');
					$(this).attr('href', 'javascript:void(0);');
				}

			}
		);
	}

	function showHighlightInfo(obj) {
		hlposition = obj.id.replace('hlimg', '');
		hlposition = parseInt(hlposition);

		infodiv = document.getElementById('hlinfo');

		infodiv.style.width = '10px';
		infodiv.style.height = '10px';

		document.getElementById('hlmoreimg').innerHTML = obj.innerHTML
		$('#hlmoreimg > img').attr('width', '180');
		$('#hlmoreimg > img').attr('height', '180');
		$('#hlmoretitle').html(Highlights[hlposition].name);
		$('#hlinfomore').attr('href', Highlights[hlposition].url);
		$('#hlinfomore').attr('title', Highlights[hlposition].title);
		
		infodiv.className = 'hlinfo' + hlposition;

		$('#hlinfo').animate ({'height':260, 'width':260}, 200);
	}

	function hideHighlightInfo() {
		$('#hlinfo').animate ({'height':0, 'width':0}, 200);
	}

	$(document).ready(function(){


		$("a").each(
			function(e){
				$(this).bind("click", function(e){
					handleclick(this);
					e.preventDefault();
				});
			}
		);

		$("form").each(
			function(e){
				hadnleform(this);
			}
		);


		currenturl = document.URL;
		urlparts = currenturl.split('#', 2);
		if (urlparts.length == 2) {
			$("#ajaxcontent").load(urlparts[1]);
		} else {
			$("#ajaxcontent").load("index_oikos.php");
		}


		// JPLAYER
		var playItem = 0;

		var myPlayList = [
			{name:"",mp3:"../dynamicpics/mp3/1.mp3"},
			{name:"",mp3:"../dynamicpics/mp3/2.mp3"},
			{name:"",mp3:"../dynamicpics/mp3/3.mp3"},
			{name:"",mp3:"../dynamicpics/mp3/4.mp3"}
];

		$("#jquery_jplayer").jPlayer({
			ready: function () {
				displayPlayList();
				playListInit(true); // Parameter is a boolean for autoplay.
			},
			cssPrefix: "oikosplayer",
			volume: 50,
			oggSupport: false
		})
		.jPlayerId("play", "player_play")
		.jPlayerId("pause", "player_pause")
		.jPlayerId("stop", "player_stop")
		.jPlayerId("loadBar", "player_progress_load_bar")
		.jPlayerId("playBar", "player_progress_play_bar")
		.jPlayerId("volumeMin", "player_volume_min")
		.jPlayerId("volumeMax", "player_volume_max")
		.jPlayerId("volumeBar", "player_volume_bar")
		.jPlayerId("volumeBarValue", "player_volume_bar_value")
		.onProgressChange( function(loadPercent, playedPercentRelative, playedPercentAbsolute, playedTime, totalTime) {
			var myPlayedTime = new Date(playedTime);
			var ptMin = (myPlayedTime.getUTCMinutes() < 10) ? "0" + myPlayedTime.getUTCMinutes() : myPlayedTime.getUTCMinutes();
			var ptSec = (myPlayedTime.getUTCSeconds() < 10) ? "0" + myPlayedTime.getUTCSeconds() : myPlayedTime.getUTCSeconds();
			$("#play_time").text(ptMin+":"+ptSec);

			var myTotalTime = new Date(totalTime);
			var ttMin = (myTotalTime.getUTCMinutes() < 10) ? "0" + myTotalTime.getUTCMinutes() : myTotalTime.getUTCMinutes();
			var ttSec = (myTotalTime.getUTCSeconds() < 10) ? "0" + myTotalTime.getUTCSeconds() : myTotalTime.getUTCSeconds();
			$("#total_time").text(ttMin+":"+ttSec);
		})
		.onSoundComplete( function() {
			playListNext();
		});

		$("#ctrl_prev").click( function() {
			playListPrev();
			return false;
		});

		$("#ctrl_next").click( function() {
			playListNext();
			return false;
		});

		function displayPlayList() {
			for (i=0; i < myPlayList.length; i++) {
				$("#playlist_list ul").append("<li id='playlist_item_"+i+"'>"+ myPlayList[i].name +"</li>");
				$("#playlist_item_"+i).data( "index", i ).hover(
					function() {
						if (playItem != $(this).data("index")) {
							$(this).addClass("playlist_hover");
						}
					},
					function() {
						$(this).removeClass("playlist_hover");
					}
				).click( function() {
					var index = $(this).data("index");
					if (playItem != index) {
						playListChange( index );
					} else {
						$("#jquery_jplayer").play();
					}
				});
			}
		}

		function playListInit(autoplay) {
			if(autoplay) {
				playListChange( playItem );
			} else {
				playListConfig( playItem );
			}
		}

		function playListConfig( index ) {
			$("#playlist_item_"+playItem).removeClass("playlist_current");
			$("#playlist_item_"+index).addClass("playlist_current");
			playItem = index;
			$("#jquery_jplayer").setFile(myPlayList[playItem].mp3, myPlayList[playItem].ogg);
		}

		function playListChange( index ) {
			playListConfig( index );
			$("#jquery_jplayer").play();
		}

		function playListNext() {
			var index = (playItem+1 < myPlayList.length) ? playItem+1 : 0;
			playListChange( index );
		}

		function playListPrev() {
			var index = (playItem-1 >= 0) ? playItem-1 : myPlayList.length-1;
			playListChange( index );
		}

 $('.topbanner').cycle({
		fx: 'fade' // choose your transition type, ex: fade, scrollUp, shuffle, etc...
	});



	});
