function hideDefaultContent(f){
	if(f.value == 'search')f.value = '';
}

function checkDefaultContent(f){
	if(f.value == '')f.value = 'search';
}

function CheckSearch(formname){
	if(document.getElementById("q").value == "" || document.getElementById("q").value == "search"){
		alert("Please enter search keywords");
		return false;
	}
}
function Divisions(ID,linkID){
	linkID.blur();
	if(currentHome != ID){		
		$('nagrakudelski').set('morph', {duration: 300});		
		var current = document.getElementById(currentHome);
		var icon = document.getElementById(currentHome + '_icon');
		var top = document.getElementById(currentHome + '_top');
		var img = document.getElementById(currentHome + '_img');
		var txt = document.getElementById(currentHome + '_txt');	
		var on = document.getElementById(currentHome + '_on');
		switch(ID){
			case 'nk':	
				$(current).set('morph', {duration: 600});
				$(icon).set('morph', {duration: 600});
				$(top).set('morph', {duration: 600});
				$(img).set('morph', {duration: 600});
				$(txt).set('morph', {duration: 600});
				$('nagrakudelski').morph('.nkopen');
				$(current).morph('.close');
				$(icon).morph('.icon_close');
				$(top).morph('.close');
				$(img).morph('.txt_close');
				$(txt).morph('.txt_close');
				$(on).morph('.icon_off');
				document.getElementById('nklink').style.cursor = 'default';
				
			break;
			case 'dtv':
				$('dtv').set('morph', {duration: 400});
				$('dtv_icon').set('morph', {duration: 400});
				$('dtv_top').set('morph', {duration: 400});
				$('dtv_img').set('morph', {duration: 400});
				$('dtv_txt').set('morph', {duration: 400});
				$('dtv').morph('.open');
				$('dtv_icon').morph('.icon_open');
				$('dtv_top').morph('.open');
				$('dtv_img').morph('.txt_open');				
				$('dtv_txt').morph('.txt_open');
				$('dtv_on').morph('.icon_on');
				document.getElementById('dtv_icon').style.cursor = 'default';
			break;
			case 'access':
				$('access').set('morph', {duration: 400});
				$('access_icon').set('morph', {duration: 400});
				$('access_top').set('morph', {duration: 400});
				$('access_img').set('morph', {duration: 400});
				$('access_txt').set('morph', {duration: 400});
				$('access').morph('.open');
				$('access_icon').morph('.icon_open');
				$('access_top').morph('.open');
				$('access_img').morph('.txt_open');				
				$('access_txt').morph('.txt_open');
				$('access_on').morph('.icon_on');
				document.getElementById('access_icon').style.cursor = 'default';
			break;
			case 'audio':
				$('audio').set('morph', {duration: 400});
				$('audio_icon').set('morph', {duration: 400});
				$('audio_top').set('morph', {duration: 400});
				$('audio_img').set('morph', {duration: 400});
				$('audio_txt').set('morph', {duration: 400});				
				$('audio').morph('.open');
				$('audio_icon').morph('.icon_open');
				$('audio_top').morph('.open');
				$('audio_img').morph('.txt_open');				
				$('audio_txt').morph('.txt_open');
				$('audio_on').morph('.icon_on');
				document.getElementById('audio_icon').style.cursor = 'default';
			break;	
		}
		if(currentHome != 'nk'){			
			$(current).set('morph', {duration: 500});
			$(icon).set('morph', {duration: 500});
			$(top).set('morph', {duration: 500});
			$(img).set('morph', {duration: 500});
			$(txt).set('morph', {duration: 500});
			$(current).morph('.close');
			$(icon).morph('.icon_close');
			$(top).morph('.close');
			$(img).morph('.txt_close');			
			$(txt).morph('.txt_close');
			$(on).morph('.icon_off');
			icon.style.cursor = 'pointer';
		}else{
			$('nagrakudelski').morph('.nkclosed');
			document.getElementById('nklink').style.cursor = 'pointer';
		}
		currentHome = ID;	
	}
	
}

function CheckRequest(form){
	var mandatory = null;
	if(form.name.value == ''){
		mandatory++;
		form.name.style.background = '#ff0000';
	}
	if(form.lname.value == ''){
		mandatory++;
		form.lname.style.background = '#ff0000';
	}
	if(form.address.value == ''){
		mandatory++;
		form.address.style.background = '#ff0000';
	}
	if(form.city.value == ''){
		mandatory++;
		form.city.style.background = '#ff0000';
	}
	if(form.zipcode.value == ''){
		mandatory++;
		form.zipcode.style.background = '#ff0000';
	}
	if(form.country.value == ''){
		mandatory++;
		form.country.style.background = '#ff0000';
	}
	if(form.agree.checked == 0){
		mandatory++;
		alert("Please accept the terms and conditions to submit");
	}
	if(mandatory != null){
		return false;
	}	
}

function DownloadImg(){
	var message	 = "";
	message	 	+= "Image Use Agreement\n";
	message 	+= "Important Image Use Information";
	message		+= "\n\n+++++++++++++++++++++++++++++\n\n";
	message 	+= "By copying or making any use of the image below, you acknowledge that you have read and understand, and agree to, the Image Usage Agreement below that governs your use of the Image. ";
	message 	+= "If you do not agree to the Agreement's terms, do not copy or use the Image in any way, unless you have written permission signed by the Kudelski Group.";
	message		+= "\n\n+++++++++++++++++++++++++++++\n\n";
	message 	+= "Usage Agreement:";
	message		+= "\n\n+++++++++++++++++++++++++++++\n\n";
	message 	+= "Subject to the terms of this Agreement, you may use the Image solely in whole for editorial use by press and/or industry analysts. This right to use is personal to you and is not transferable by you to another party. ";
	message 	+= "The Image cannot be used to promote or sell any product or technology (such as on advertising, brochures, book-covers, stock photos, t-shirts, or other promotional merchandise). You may not alter, or modify the Image, in whole or in part, for any reason.\n\n";
	message 	+= "As between you and the Kudelski Group, the Kudelski Group is and shall remain the sole and exclusive owner of the Image. ";
	message 	+= "You will not delete, alter, or obfuscate any proprietary legends relating to the Image, and each use will be accompanied by the applicable proprietary attribution shown next to the Image.\n\n";
	message 	+= "The Image is provided by the Kudelski Group on an 'as is' basis, without warranty of any kind, including non-infringement or ownership. You, not the Kudelski Group, are responsible for your use of the Image. ";
	message 	+= "Any misuse of the Image or breach of this Agreement will cause the Kudelski Group irreparable harm. The Kudelski Group is either an owner or licensee of the image, not an agent for the owner. ";
	message 	+= "We understand that you will give our company a credit line as follows: 'Courtesy of The Kudelski Group' and also credit the photographer if noted.\n";
	message		+= "\n\n+++++++++++++++++++++++++++++\n\n";
	message 	+= "I have read, understand and agree to the Image Usage Agreement.\n";
	message 	+= "(Image will immediately begin download)";
	return confirm(message);
}

function ToggleMandates(el){
	var elVis = document.getElementById(el);
	if(elVis.style.display == 'none'){
		elVis.style.display = 'inline';
	}else{
		elVis.style.display = 'none';
	}
	return false;
}
