function oldbrowser()
{
	if(document.getElementById){
	}
	else{
	document.location.href="http://framework.franke.firm/oldbrowser/index.html";
	}
}




function Changegrfx(id,src)
{
document.getElementById(id).src = src;
}


function ShowHideDiv(id,style)
{
document.getElementById(id).style.visibility = style;

}


function PopUpWindow(url,windowname,breite,hoehe,scroll,rez,tool,menu,loc,horz,vert)
{
// PopUpWindowGenerator

// url= zu öffnende url
// windowname = name des fensters
// breite = Breite des Fensters
// hoehe = Hoehe des Fensters
// scroll = Scrollbar (yes or no)
// rez = rezisable (yes or no)
// tool = Toolbar (yes or no)
// menu = Menubar (yes or no)
// horz = horizontale Ausrichtung (center or left or right)
// vert = vertikale Ausrichtung (top or middle or bottom)

var url;
var windowname;
var breite;
var hoehe;
var scroll;
var rez;
var tool;
var menu;
var loc;
var winl;
var wint;
var horz;
var vert;


// Berechnen von wint
if(vert=='top')
{
wint = 0;
}

if(vert=='middle')
{
wint = (screen.height - hoehe) / 2;
}

if(vert=='bottom')
{
wint = (screen.height - hoehe);
}
// Ende Berechnen von wint

		// Funktionsaufruf mit horz
		if(horz=='center')
		{
		winl = (screen.width - breite) / 2;
		popupwindow = 
		window.open(url,windowname, 'width='+breite+',height='+hoehe+',screenX='+winl+',screenY='+wint+',left='+winl+',top='+wint+',scrollbars='+scroll+',resizable='+rez+',toolbar='+tool+',menubar='+menu+',location='+loc);
		popupwindow.focus();
		}
		else
		{
			if(horz=='left')
			{
			winl = 0;
			popupwindow = 
			window.open(url,windowname, 'width='+breite+',height='+hoehe+',screenX='+winl+',screenY='+wint+',left='+winl+',top='+wint+',scrollbars='+scroll+',resizable='+rez+',toolbar='+tool+',menubar='+menu+',location='+loc);
			popupwindow.focus();
			
			}
			
			if(horz=='right')
			{
			winl = (screen.width - breite);
			popupwindow = 
			window.open(url,windowname, 'width='+breite+',height='+hoehe+',screenX='+winl+',screenY='+wint+',left='+winl+',top='+wint+',scrollbars='+scroll+',resizable='+rez+',toolbar='+tool+',menubar='+menu+',location='+loc);
			popupwindow.focus();
			
			}
		
		
		}
		// Ende Funktionsaufruf mit horz

// Funnktion schliessen
}



function clpSet(txt)
{
sel = document.selection.createRange();
window.clipboardData.setData("Text",txt);
}


function confirm_delete(x,y,url){
	var x;
	var y;
	var url;
	
	
	input_box=confirm("Are you sure you d'like to delete record  "+x+" ?");
		if (input_box==true)

		{ 
		// redirect when OK
		window.location = url; 
		}

		else
		{

		}

}


function MM_validateForm() { //v3.0
  var i,p,q,nm,test,num,min,max,errors='',args=MM_validateForm.arguments;
  for (i=0; i<(args.length-2); i+=3) { test=args[i+2]; val=MM_findObj(args[i]);
    if (val) { nm=val.name; if ((val=val.value)!="") {
      if (test.indexOf('isEmail')!=-1) { p=val.indexOf('@');
        if (p<1 || p==(val.length-1)) errors+='- '+nm+' must contain an e-mail address.\n';
      } else if (test!='R') { num = parseFloat(val);
        if (val!=''+num) errors+='- '+nm+' must contain a number.\n';
        if (test.indexOf('inRange') != -1) { p=test.indexOf(':');
          min=test.substring(8,p); max=test.substring(p+1);
          if (num<min || max<num) errors+='- '+nm+' must contain a number between '+min+' and '+max+'.\n';
    } } } else if (test.charAt(0) == 'R') errors += '- '+nm+' is required.\n'; }
  } if (errors) alert('The following error(s) occurred:\n'+errors);
  document.MM_returnValue = (errors == '');
}

function MM_findObj(n, d) { //v3.0
  var p,i,x;  if(!d) d=document; if((p=n.indexOf("?"))>0&&parent.frames.length) {
    d=parent.frames[n.substring(p+1)].document; n=n.substring(0,p);}
  if(!(x=d[n])&&d.all) x=d.all[n]; for (i=0;!x&&i<d.forms.length;i++) x=d.forms[i][n];
  for(i=0;!x&&d.layers&&i<d.layers.length;i++) x=MM_findObj(n,d.layers[i].document); return x;
}


function MM_jumpMenu(targ,selObj,restore){ //v3.0
  eval(targ+".location='"+selObj.options[selObj.selectedIndex].value+"'");
  if (restore) selObj.selectedIndex=0;
}


// ------------------------------ Additional Scripts Seisan 2003 ------------------------

function trim(str) { return( (""+str).replace(/^\s*([\s\S]*\S+)\s*$|^\s*$/,'$1') ); }


function checkOrderQty(thisform)
{

	var ret_val = true;
	
	if ( thisform.qty.value == null || thisform.qty.value == "" )
	{
		ret_val = false;
		alert("You must fill in a quantity");
	}
	else
	{
		if (isNaN(thisform.qty.value))
		{
			ret_val = false;
			alert("You must fill in a valid quantity");
		}
		else
		{
			if (parseInt(thisform.qty.value) <= 0)
			{
				ret_val = false;
				alert("You must fill in valid quantity");
			}
		}
	
	}

	return ret_val;
}


function checkQtyField(thisfield)
{
	

	if (thisfield.value == "" || thisfield.value == null)
	{
		
		alert("You cannot remove an item by changing the quantity, to remove this item click on the remove button");
		thisfield.focus();
		thisfield.select();
	}
	else
	{
		if (isNaN(thisfield.value))
		{
			
			alert("You must fill in a valid quantity");
			thisfield.focus();
			thisfield.select();
		}
		else
		{
			if (parseInt(thisfield.value) <= 0)
			{
				
				alert("You must fill in valid quantity");
				thisfield.focus();
				thisfield.select();
			}
		}
	
	}


}


function launchSelected(thisfield, pathStr)
{

	
	window.location = pathStr + thisfield[thisfield.selectedIndex].value;

}


//----------------------- FORM VALIDATION FUNCTIONS ---------------------
function formvalidationContact(thisform)
{

 var ret_val = true;


if ( (thisform.firstname.value == null) || (thisform.firstname.value == "") )
	ret_val = false;

if ( (thisform.lastname.value == null) || (thisform.lastname.value == "") )
	ret_val = false;
	
if ( (thisform.address1.value == null) || (thisform.address1.value == "") )
	ret_val = false;
	
if ( (thisform.city.value == null) || (thisform.city.value == "") )
	ret_val = false;

if ( (thisform.zip.value == null) || (thisform.zip.value == "") )
	ret_val = false;

if ( (thisform.states.value == null) || (thisform.states.value == "Choose a state") )
	ret_val = false;

if ( (thisform.email.value == null) || (thisform.email.value == "") )
	ret_val = false;

if (ret_val == false)
	alert("Please fill in all require fields indicated by *");


 return ret_val;
 
}


function formvalidationFilterReg(thisform)
{

 var ret_val = true;


if ( (thisform.firstname.value == null) || (thisform.firstname.value == "") )
	ret_val = false;

if ( (thisform.lastname.value == null) || (thisform.lastname.value == "") )
	ret_val = false;
	
if ( (thisform.address1.value == null) || (thisform.address1.value == "") )
	ret_val = false;
	
if ( (thisform.city.value == null) || (thisform.city.value == "") )
	ret_val = false;

if ( (thisform.zip.value == null) || (thisform.zip.value == "") )
	ret_val = false;

if ( (thisform.states.value == null) || (thisform.states.value == "Choose a state") )
	ret_val = false;
	
if ( (thisform.phone.value == null) || (thisform.phone.value == "") )
	ret_val = false;

if ( (thisform.model.value == null) || (thisform.model.value == "") )
	ret_val = false;

if ( (thisform.serial.value == null) || (thisform.serial.value == "") )
	ret_val = false;


if (ret_val == false)
	alert("Please fill in all require fields indicated by *");


 return ret_val;
}

function formvalidationCheckOut(thisform)
{

 var ret_val = true;


if ( (thisform.firstname.value == null) || (thisform.firstname.value == "") )
	ret_val = false;

if ( (thisform.lastname.value == null) || (thisform.lastname.value == "") )
	ret_val = false;
	
if ( (thisform.address1.value == null) || (thisform.address1.value == "") )
	ret_val = false;
	
if ( (thisform.city.value == null) || (thisform.city.value == "") )
	ret_val = false;

if ( (thisform.zip.value == null) || (thisform.zip.value == "") )
	ret_val = false;

if ( (thisform.states.value == null) || (thisform.states.value == "Choose a state") )
	ret_val = false;
	

//if ( (thisform.phone.value == null) || (thisform.phone.value == "") )
//	ret_val = false;

//if ( (thisform.email.value == null) || (thisform.email.value == "") )
//	ret_val = false;



if ( (thisform.cardno.value == null) || (thisform.cardno.value == "") )
	ret_val = false;
	
if ( (thisform.month.value == null) || (thisform.month.value == "") )
	ret_val = false;
	
if ( (thisform.year.value == null) || (thisform.year.value == "") )
	ret_val = false;
	
	
	
if ( (thisform.shipfirstname.value == null) || (thisform.shipfirstname.value == "") )
	ret_val = false;

if ( (thisform.shiplastname.value == null) || (thisform.shiplastname.value == "") )
	ret_val = false;
	
if ( (thisform.shipaddress1.value == null) || (thisform.shipaddress1.value == "") )
	ret_val = false;
	
if ( (thisform.shipcity.value == null) || (thisform.shipcity.value == "") )
	ret_val = false;

if ( (thisform.shipzip.value == null) || (thisform.shipzip.value == "") )
	ret_val = false;

if ( (thisform.shipstates.value == null) || (thisform.shipstates.value == "Choose a state") )
	ret_val = false;

if (ret_val == false)
	alert("Please fill in all require fields indicated by *");


 return ret_val;
 
}


