<!-- hide script from old browsers

function externalLinks() {
 if (!document.getElementsByTagName) return;
 var anchors = document.getElementsByTagName("a");
 for (var i=0; i<anchors.length; i++) {
   var anchor = anchors[i];
   if (anchor.getAttribute("href") &&
       anchor.getAttribute("rel") == "external")
     anchor.target = "_blank";
 }
}


function loadOnStart(){
	$('#usr_email, #usr_pass, #email').each(function() {
	    var default_value = this.value;
	    $(this).focus(function() {
	        if(this.value == default_value) {
	            this.value = '';
	        }
	    });
	    $(this).blur(function() {
	        if(this.value == '') {
	            this.value = default_value;
	        }
	    });
	});
	$('.fullarticle').slideUp();
	$(".articleMore").click(function(event){
		var currentId = $(this).attr('id');
		$("#full"+currentId).slideDown("slow");
		$("#p"+currentId).slideUp("slow");
		// Stop the link click from doing its normal thing
		event.preventDefault();
	});
	$(".nCloseMore").click(function(event){
		var currentId = $(this).attr('id').substr(1);
		$("#full"+currentId).slideUp("slow");
		$("#p"+currentId).slideDown("slow");
		// Stop the link click from doing its normal thing
		event.preventDefault();
	});
}

window.onload = function() {
	loadOnStart();
	externalLinks();
}

$(document).ready(function(){
	$('.dateField').datepick({dateFormat: 'dd.mm.yyyy'});
	$('textarea.editor').tinymce({
		// Location of TinyMCE script
		script_url : '../js/tiny_mce/tiny_mce.js',

		// General options
		theme : "advanced",
		force_p_newlines : false,
		plugins : "autolink,lists,pagebreak,style,layer,save,advhr,advlink,iespell,inlinepopups,insertdatetime,preview,media,searchreplace,print,contextmenu,paste,directionality,noneditable,visualchars,nonbreaking,xhtmlxtras,template,advlist",

		// Theme options
		theme_advanced_buttons1 : "save,newdocument,|,bold,italic,underline,strikethrough,|,justifyleft,justifycenter,justifyright,justifyfull,formatselect",
		theme_advanced_buttons2 : "cut,copy,paste,pastetext,pasteword,|,search,replace,|,bullist,numlist,|,undo,redo,|,link,unlink,anchor|,insertdate,inserttime,preview|,visualchars,nonbreaking,template,pagebreak",
		theme_advanced_toolbar_location : "top",
		theme_advanced_toolbar_align : "left",
		theme_advanced_statusbar_location : "bottom",
		theme_advanced_resizing : true,

		// Example content CSS (should be your site CSS)
		content_css : "css/content.css",

		// Drop lists for link/image/media/template dialogs
		template_external_list_url : "lists/template_list.js",
		external_link_list_url : "lists/link_list.js",
		external_image_list_url : "lists/image_list.js",
		media_external_list_url : "lists/media_list.js",

		// Replace values for the template plugin
		template_replace_values : {
			username : "Some User",
			staffid : "991234"
		}
	});
	$("#rangeMenu").fadeOut();
	$("#productsLink").mouseenter(function(){
		$("#rangeMenu").fadeIn();
	});
	$("#productsLink").mouseleave(function(){
		$("#rangeMenu").fadeOut();
	});

});

// end hiding script from old browsers -->

