function myFormSubmit(formName)
{	
	$("#login_form_id").submit(function() {
	  alert('Handler for .submit() called.');
	  return false;
	});
}	

function newnoteconfirm(urls, string){
	really = confirm(string);
	if (really==true) document.location.href = urls;
}

function popUpCertDetail(URL) {
		day = new Date();
		id = day.getTime();
		eval("page" + id + " = window.open(URL, '" + id + "', 'toolbar=0,scrollbars=1,location=0,statusbar=0,menubar=0,resizable=1,width=660,height=750,left = 10,top = 10');");
	}

	function popUpCertList(URL) {
		day = new Date();
		id = day.getTime();
		eval("page" + id + " = window.open(URL, '" + id + "', 'toolbar=0,scrollbars=1,location=0,statusbar=0,menubar=0,resizable=1,width=860,height=700,left = 10,top = 10');");
	}

	function popUpEvSheet(URL) {
		day = new Date();
		id = day.getTime();
		eval("page" + id + " = window.open(URL, '" + id + "', 'toolbar=0,scrollbars=1,location=0,statusbar=0,menubar=0,resizable=1,width=860,height=700,left = 10,top = 10');");
	}

	function popUpHistory(URL) {
		day = new Date();
		id = day.getTime();
		eval("page" + id + " = window.open(URL, '" + id + "', 'toolbar=0,scrollbars=1,location=0,statusbar=0,menubar=0,resizable=1,width=1024,height=700,left = 10,top = 10');");
	}

	function popWhatIs(URL) {
		day = new Date();
		id = day.getTime();
		eval("page" + id + " = window.open(URL, '" + id + "', 'toolbar=0,scrollbars=0,location=0,statusbar=0,menubar=0,resizable=1,width=640,height=725,left = 10,top = 10');");
	}
	
	function popOverviewOFCustomers(URL) {
		day = new Date();
		id = day.getTime();
		eval("page" + id + " = window.open(URL, '" + id + "', 'toolbar=0,scrollbars=1,location=0,statusbar=0,menubar=0,resizable=1');");
	}

	function popUpCT(URL) {
		day = new Date();
		id = day.getTime();
		eval("page" + id + " = window.open(URL, '" + id + "', 'toolbar=0,scrollbars=1,location=0,statusbar=0,menubar=0,resizable=0,width=660,height=600');");
	}

	function HelpWindow(URL) {
		day = new Date();
		id = day.getTime();
		eval("page" + id + " = window.open(URL, '" + id + "', 'toolbar=0,scrollbars=1,location=0,statusbar=0,menubar=0,resizable=1,width=660,height=700,left = 10,top = 10');");
	}

	function popAuditorsScope(URL) {
		day = new Date();
		id = day.getTime();
		eval("page" + id + " = window.open(URL, '" + id + "', 'toolbar=0,scrollbars=1,location=0,statusbar=0,menubar=0,resizable=1');");
	}

	function	MyFocus(form, obj){
		document.form.obj.focus();
		return true;
	}

	function VDS_AGB(){
		if(document.getElementById("FLD_VDSAGB").checked==true){
			document.getElementById("SUB_ORDERSTANDARD3").disabled = false;
		}else{
			document.getElementById("SUB_ORDERSTANDARD3").disabled = true;
		}
	}

	function AUDIT_AGB(){
		if(document.getElementById("FLD_AUDITAGB").checked == true){
			document.getElementById("SUB_ORDER_2").disabled = false;
		}else{
			document.getElementById("SUB_ORDER_2").disabled = true;
		}
	}

	function SubmitWorldPay(){
		document.forms['FLD_WORLPAY'].submit();
	}
	
	function getNodes(one,etype){
		 var nodelist;	// local scope variables
		 var count;
		 var count_comp = 0;
		 nodelist = one.childNodes;
		 count = nodelist.length;
		 for(i = 0; i < count; i++)
		 {
		  mn = nodelist[i];
		  if(mn.nodeName == etype)
		  {
			count_comp = count_comp + 1;
		  }
		 }
		 return count_comp;		
	}	
	
	function changeDisplayByName(tmpElement)
	{
		try
		  {
		  	a = Array();
			a = document.getElementsByName(tmpElement);
			
			for (var i=0; i < a.length; ++i) {
				if(a[i].className == 'hidden')
					a[i].className = 'show';
				else
					a[i].className = 'hidden';
				
			}
		  } 
		catch(e) 
		  {
		    alert(tmpElement + ' By Name # ist nicht definiert');
		  }
		try
		  {
			for (var ii=1; ii < 10; ++ii) 
			{
				if(tmpElement != ii)
				{
					a = document.getElementsByName(ii);
					for (var i=0; i < a.length; ++i)
						a[i].className = 'hidden';
				}
			}
		  } 
		catch(e) 
		  {
		    alert(tmpElement + ' By Name # ist nicht definiert');
		  }
	}
/*
 * Author: Rob Reid
 * CreateDate: 20-Mar-09
 * Description: Little helper function to return details about IE 8 and its various compatibility settings either use as it is
 * or incorporate into a browser object. Remember browser sniffing is not the best way to detect user-settings as spoofing is
 * very common so use with caution.
*/
function IEVersion(){
	var _n=navigator,_w=window,_d=document;
	var version="NA";
	var na=_n.userAgent;
	var ieDocMode="NA";
	var ie8BrowserMode="NA";
	// Look for msie and make sure its not opera in disguise
	if(/msie/i.test(na) && (!_w.opera)){
		// also check for spoofers by checking known IE objects
		if(_w.attachEvent && _w.ActiveXObject){		
			// Get version displayed in UA although if its IE 8 running in 7 or compat mode it will appear as 7
			version = (na.match( /.+ie\s([\d.]+)/i ) || [])[1];
			// Its IE 8 pretending to be IE 7 or in compat mode		
			if(parseInt(version)==7){				
				// documentMode is only supported in IE 8 so we know if its here its really IE 8
				if(_d.documentMode){
					version = 8; //reset? change if you need to
					// IE in Compat mode will mention Trident in the useragent
					if(/trident\/\d/i.test(na)){
						ie8BrowserMode = "Compat Mode";
					// if it doesn't then its running in IE 7 mode
					}else{
						ie8BrowserMode = "IE 7 Mode";
					}
				}
			}else if(parseInt(version)==8){
				// IE 8 will always have documentMode available
				if(_d.documentMode){ ie8BrowserMode = "IE 8 Mode";}
			}
			// If we are in IE 8 (any mode) or previous versions of IE we check for the documentMode or compatMode for pre 8 versions			
			ieDocMode = (_d.documentMode) ? _d.documentMode : (_d.compatMode && _d.compatMode=="CSS1Compat") ? 7 : 5;//default to quirks mode IE5				   			
		}
	}
				 
	return {
		"UserAgent" : na,
		"Version" : version,
		"BrowserMode" : ie8BrowserMode,
		"DocMode": ieDocMode
	}			
}	
	
		
