$(document).ready(function () {
	

    $('#notificationDiv').effect("highlight", {color:'#D3ECF5'}, 5000);


	$("a[rel^='photoBox']").prettyPhoto( {theme: 'light_square' });	/* light_rounded / dark_rounded / light_square / dark_square */	
			if(window.outerWidth){
				$("#loader").width(window.outerWidth); /* window.outerWidth;*/
				$("#loader").height(window.outerHeight); /* window.outerHeight;*/
			}else{
				$("#loader").width(document.body.clientWidth); /* window.outerWidth;*/
				$("#loader").height(document.body.clientHeight); /* window.outerHeight;*/
			}
	
	// + Print button + //
	$(".print").click(function(){
		window.print() ;
		return false;
	});
	// - Print button - //
	// + Make boxes clickable + //
	$(".clickbox").each(function () {
		$(this).click(function(){
			
			var href = $(this).find("a.readmore").attr("href");
			
			if (href){
				var target = $(this).find("a.readmore").attr("target");
				
				if (target == "_blank"){
					window.open(href);
					//parent.location.href = href;
				} else {
					document.location = href;
				}
			}
		});
		$(this).hover(function() { 
			$(this).addClass('active');   
		  }, function() {   
			$(this).removeClass('active');
		});
	});
	// - Make boxes clickable - //
  
	// + Set language effect + //
	$("#languages").hide();
		  
	$("#languageClick").click(function () {
		
        $("#languages").slideToggle("normal");
     return false;
	});
	// - Set language effect -//
	
	// CONFIRM: asked to confirm before leaving to href url
	$(".jConfirm").click(function(event) {  
		event.preventDefault();  // prevent the anchor tag from sending the user off to the link   
		var url = this.href; 
		var title = this.title;
		var yousure = confirm(title);
		
		if (yousure == true) {
			document.location = url;
		} else {
			// Do nothing
		}		
	
	});
	$('.jHighlight').mouseover(function(event) {

		$(this).addClass('highlight');

	}).mouseout(function(event) {

		$(this).removeClass('highlight');

	});

	imagePreview();
	
	$('.box ul').accordion(); // Set accordion effect
	$('.test ul').accordion(); // Set accordion effect
	
	/*$('#eyecatcher').cycle({ 
    	fx:      'fade', 
		timeout:  5000 
	});*/
	
	$(function() {
			$('#show').find('img').each(function(){
				this.style.display = 'block';
			});
			if(document.getElementById('eyecatcher')){
				document.getElementById('eyecatcher').style.display = 'block';
				$('#show').cycle({
					fx:     'fade',
					timeout: 7000,
					pager:  '#nav',
					pagerEvent: 'mouseover',
					pauseOnPagerHover: '1',
					pagerAnchorBuilder: function(idx, slide) {
						// return sel string for existing anchor
						return '#nav li:eq(' + (idx) + ') a';
					}
					
				});
			}
	});
		
	$('#rssBlock').cycle({ 
    	fx:      	'fade', 
		timeout:	3600000
	});
	
	// POPUP: launches url in a new resizale popup window 
	$(".jPopup").click(function(event) {  
		event.preventDefault();  // prevent the anchor tag from sending the user off to the link   

		var url 	= this.href;
		var title 	= this.title;
		var regex 	= /\|[0-9]+\|[0-9]+\|$/;
		var day 	= new Date();
		var id 		= day.getTime();

		if (title.match(regex)) {
			// get dimensions
			var dimensions = String(regex.exec(title));
			var dimensionsArr = dimensions.split("|");
			
			// use user defined dimensions, not resizable
			eval("page" + id + " = window.open(url, '" + id + "', 'toolbar=0,scrollbars=0,location=0,statusbar=0,menubar=0,resizable=0,width=" + dimensionsArr[1] + ",height=" + dimensionsArr[2] + ",left = 100,top = 100');");
		} else {
			// use standard dimensions, keep resizable
			eval("page" + id + " = window.open(url, '" + id + "', 'toolbar=1,scrollbars=1,location=1,statusbar=1,menubar=1,resizable=1,width=800,height=600,left = 100,top =100');");
		}	
	
	});	


//loadScript();

});

function loadpage(){
	
	alert('test');
	}
