// JavaScript Document
function confirmation(val) {
        return confirm(val);
}

//jump menu //MM_jumpMenu('parent',this,0)
function MM_jumpMenu(targ,selObj,restore){ //v3.0
  eval(targ+".location='"+selObj.options[selObj.selectedIndex].value+"'");
  if (restore) selObj.selectedIndex=0;
}


function refreshPage(){
  eval(location.reload(true));
}

function SubmitForm(){
	//document.name.action = "anotherpage.html";
	document.Form1.submit();
}

function ResetForm(){
	document.Form1.reset();
}


//excecute lightbox from flash
function LightboxDelegate(url,caption) {

	var objLink = document.createElement('a');
	
	objLink.setAttribute('href',url);
	
	objLink.setAttribute('rel','lightbox');
	
	objLink.setAttribute('title',caption);
	
	Lightbox.prototype.start(objLink);

}

function limitText(textArea, length) {
	if (textArea.value.length > length) {
		textArea.value = textArea.value.substr(0,length);
	}
}

function check_length(elementID,maxLen){

	if(document.getElementById(elementID)){
	
		var textArea = document.getElementById(elementID);
			
		if(textArea.value.length > maxLen+1){
			var msg = "You have reached the maximum "+ maxLen +" characters limit.";
			alert(msg);
		}
		
		if(textArea.value.length > maxLen){
			textArea.value = textArea.value.substr(0,maxLen);

		}
		
	}
		
}
