// POPUP

PositionX = 100;
PositionY = 100;
defaultWidth = 300;
defaultHeight = 250;
var AutoClose = true;
if (parseInt(navigator.appVersion.charAt(0))>=4){
var isNN=(navigator.appName=="Netscape")?1:0;
var isIE=(navigator.appName.indexOf("Microsoft")!=-1)?1:0;}
var optNN='scrollbars=no,width='+defaultWidth+',height='+defaultHeight+',left='+PositionX+',top='+PositionY;
var optIE='scrollbars=no,width='+defaultWidth+',height='+defaultHeight+',left='+PositionX+',top='+PositionY;
function popImage(imageURL,imageTitle){
if (isNN){imgWin=window.open('about:blank','',optNN);}
if (isIE){imgWin=window.open('about:blank','',optIE);}
with (imgWin.document){
writeln('<html><head><title>Detaildarstellung '+imageTitle+'</title><style>body{margin:0px;}</style>');writeln('<sc'+'ript>');
writeln('var isNN,isIE;');writeln('if (parseInt(navigator.appVersion.charAt(0))>=4){');
writeln('isNN=(navigator.appName=="Netscape")?1:0;');
writeln('isIE=(navigator.appName.indexOf("Microsoft")!=-1)?1:0;}');
writeln('function reSizeToImage(){');
writeln('if (isIE){window.resizeTo(50+document.images[0].width,110+document.images[0].height);}');
writeln('if (isNN){window.resizeTo(50+document.images[0].width,110+document.images[0].height);}');
writeln('}');
writeln('function doTitle(){document.title="'+imageTitle+'";}');
writeln('</sc'+'ript>');
if (!AutoClose) 
writeln('</head><body bgcolor=EEEEEE scroll="no" onload="reSizeToImage();doTitle();self.focus()">')
else 
writeln('</head><body bgcolor=EEEEEE scroll="no" onload="reSizeToImage();doTitle();self.focus()" onblur="self.close()">');
writeln('<center><a href="javascript:window.close()"><img name="Product" src='+imageURL+' alt="Fenster schliessen" title="Fenster schliessen" vspace="5" hspace="5" border="0"><br><font face="Arial" size="1"><b>Fenster schliessen</b></font></a></center></body></html>');
close();		
}}


// MULTIPICS

function newImage(arg) {
	if (document.images) {
		rslt = new Image();
		rslt.src = arg;
		return rslt;
	}
}

function changeImages() {
	if (document.images && (preloadFlag == true)) {
		for (var i=0; i<changeImages.arguments.length; i+=2) {
			document[changeImages.arguments[i]].src = changeImages.arguments[i+1];
		}
	}
}

var preloadFlag = false;
function preloadImages() {
	if (document.images) {
		loginbut_over = newImage("buttons/loginbut_over.gif");
		searchbut_over = newImage("buttons/searchbut_over.gif");
		faqbut_over = newImage("buttons/faqbut_over.gif");
		privacybut_over = newImage("buttons/privacybut_over.gif");
		companybut_over = newImage("buttons/companybut_over.gif");
		contactbut_over = newImage("buttons/contactbut_over.gif");
		homebut_over = newImage("buttons/homebut_over.gif");
		warrantybut_over = newImage("buttons/warrantybut_over.gif");
		dropshipbut_over = newImage("buttons/dropshipbut_over.gif");
		faqbut_over = newImage("buttons/faqbut_over.gif");
		accountbut_over = newImage("buttons/accountbut_over.gif");
		indexbut_over = newImage("buttons/indexbut_over.gif");
		updatebut_over = newImage("buttons/updatebut_over.gif");
		downloadbut_over = newImage("buttons/downloadbut_over.gif");
		inventorybut_over = newImage("buttons/inventorybut_over.gif");
		preloadFlag = true;
	}
}

var enablepersist="off" //Enable saving state of content structure using session cookies? (on/off)
var collapseprevious="yes" //Collapse previously open content when opening present? (yes/no)

if (document.getElementById){
document.write('<style type="text/css">')
document.write('.switchcontent{display:none;}')
document.write('</style>')
}

function getElementbyClass(classname){
ccollect=new Array()
var inc=0
var alltags=document.all? document.all : document.getElementsByTagName("*")
for (i=0; i<alltags.length; i++){
if (alltags[i].className==classname)
ccollect[inc++]=alltags[i]
}
}

function contractcontent(omit){
var inc=0
while (ccollect[inc]){
if (ccollect[inc].id!=omit)
ccollect[inc].style.display="none"
inc++
}
}

function expandcontent(cid){
if (typeof ccollect!="undefined"){
if (collapseprevious=="yes")
contractcontent(cid)
document.getElementById(cid).style.display=(document.getElementById(cid).style.display!="block")? "block" : "none"
}
}

function revivecontent(){
contractcontent("omitnothing")
selectedItem=getselectedItem()
selectedComponents=selectedItem.split("|")
for (i=0; i<selectedComponents.length-1; i++)
document.getElementById(selectedComponents[i]).style.display="block"
}

function get_cookie(Name) { 
var search = Name + "="
var returnvalue = "";
if (document.cookie.length > 0) {
offset = document.cookie.indexOf(search)
if (offset != -1) { 
offset += search.length
end = document.cookie.indexOf(";", offset);
if (end == -1) end = document.cookie.length;
returnvalue=unescape(document.cookie.substring(offset, end))
}
}
return returnvalue;
}

function getselectedItem(){
if (get_cookie(window.location.pathname) != ""){
selectedItem=get_cookie(window.location.pathname)
return selectedItem
}
else
return ""
}

function saveswitchstate(){
var inc=0, selectedItem=""
while (ccollect[inc]){
if (ccollect[inc].style.display=="block")
selectedItem+=ccollect[inc].id+"|"
inc++
}

document.cookie=window.location.pathname+"="+selectedItem
}

function do_onload(){
getElementbyClass("switchcontent")
if (enablepersist=="on" && typeof ccollect!="undefined")
revivecontent()
}


if (window.addEventListener)
window.addEventListener("load", do_onload, false)
else if (window.attachEvent)
window.attachEvent("onload", do_onload)
else if (document.getElementById)
window.onload=do_onload

if (enablepersist=="on" && document.getElementById)
window.onunload=saveswitchstate


function checkfields1() 
{

if (document.myForm.elements['customerID'].value == "") 
   {
      alert ("\n Enter a Customer ID\t\n");
      document.myForm.elements['customerID'].focus();
      return false;      
   }

if (document.myForm.elements['customerpass'].value == "") 
   {
      alert ("\n Enter a password. First time users enter your zip code or email address.\t\n");
      document.myForm.elements['customerpass'].focus();
      return false;      
   }

}

function checkfields() 
{

if (document.myForm.elements['customerpass1'].value != document.myForm.elements['customerpass2'].value) 
   {
      alert ("\nYour password fields do not match try again\t\n");
      document.myForm.elements['customerpass1'].focus();
      return false;      
   }

}


// Package	: JavaScript Assist Tools
// Programmer	: R. Stolfa (rstolfa@yahoo.com)
// Module	: autotab()
// SCCSid	: %Z% %M% %I% %D%
//
// Purpose :	autotab moves the browser focus to the "next" element
//		once the current one is "full".  Here the form name is
//		set to "ABCDEF" so that you can change it easily
//
// Modification History:
//   19970731	Created
//
function autotab(fn, fl) {
        var i;
        var idx;
        var next;        
        var docele;
        
        idx = -1;        
        for (i = 0; i < document.myForm.length; i ++) {
                if (document.myForm.elements[i].name == fn.name)
                        idx = i;
        }                
        if (idx != -1) {
                // Find the next 'field'
                next = idx + 1;
                if (next >= document.myForm.length)
                        next = 0 

                // Figure out the length of the given element.                        
                docele = document.myForm.elements[idx].value;
                if (docele.length == fl) {
                        document.myForm.elements[next].focus();
                }
        }        
}


