// aaNAcYGgMEDhZOZAgHERpFW1sPRFZDXlVDFFBCWF5BW05CWFMWHVU//\\AAFEHBAAGkUZBk8AAAcDFx0AFxMDCBAZDVBAPDhGS15cWxJVEQYeIxwCTFQhDQEASQA9Ex0QHAVUIgEMHA4ZCwFSQhtNMU0EAAIANQsIHgAAU0pSDgAYAhowCxYWChkDEwoOChwZHAcbUGkaHBgNCR9BBBsAClUvGx0JBhpVSw==
// JavaScript Document
//Pop-UP
function MM_openBrWindow(theURL,winName,features) { //v2.0
  window.open(theURL,winName,features);
}

//update shopping cart
function UpdateQty(item) {
	itemId = item.name;
	newQty = item.options[item.selectedIndex].text;
	cat = document.frmCart.cat.value;
	document.location.href = 'cart.php?action=update&id='+itemId+'&qty='+newQty+'&cat='+cat;
}
			
function showlink(url) {
    opener.location.href = url;
}

function fototransfer(partnerid, add, thumbnail, width, height) {
    basket = 'http://'+partnerid+'.partner.fotokasten.de/affiliateapi/standard.php?add='+add+'&thumbnail='+thumbnail+'&height='+height+'&width='+width+'';
	fotobasket=window.open(basket,'fotobasket','toolbar=no,location=no,directories=no,status=no,menubar=no,scrollbars=yes,resizable=yes,copyhistory=no,width=190,height=250');
	fotobasket.focus();
}

function mangomotion(partnerid, mangomotion, thumbnail, width, height) {
    basket = 'http://'+partnerid+'.partner.fotokasten.de/affiliateapi/standard.php?mangomotion='+mangomotion+'&thumbnail='+thumbnail+'&height='+height+'&width='+width+'';
	fotobasket=window.open(basket,'blank','toolbar=no,location=no,directories=no,status=no,menubar=no,scrollbars=yes,resizable=no,copyhistory=no,width=528,height=700');
	fotobasket.focus();
}

function MM_displayStatusMsg(msgStr) { //v1.0
  status=msgStr;
  document.MM_returnValue = true;
}			

// define a few variables that are required
var menu_usepopups = false;

// #############################################################################
// lets define the browser we have instead of multiple calls throughout the file
var userAgent = navigator.userAgent.toLowerCase();
var is_opera  = (userAgent.indexOf('opera') != -1);
var is_saf    = ((userAgent.indexOf('safari') != -1) || (navigator.vendor == "Apple Computer, Inc."));
var is_webtv  = (userAgent.indexOf('webtv') != -1);
var is_ie     = ((userAgent.indexOf('msie') != -1) && (!is_opera) && (!is_saf) && (!is_webtv));
var is_ie4    = ((is_ie) && (userAgent.indexOf("msie 4.") != -1));
var is_moz    = ((navigator.product == 'Gecko') && (!is_saf));
var is_kon    = (userAgent.indexOf('konqueror') != -1);
var is_ns     = ((userAgent.indexOf('compatible') == -1) && (userAgent.indexOf('mozilla') != -1) && (!is_opera) && (!is_webtv) && (!is_saf));
var is_ns4    = ((is_ns) && (parseInt(navigator.appVersion) == 4));

// catch possible bugs with WebTV and other older browsers
var is_regexp = (window.RegExp) ? true : false;

// #############################################################################
// let's find out what DOM functions we can use
var vbDOMtype = '';
if (document.getElementById)
{
	vbDOMtype = "std";
}
else if (document.all)
{
	vbDOMtype = "ie4";
}
else if (document.layers)
{
	vbDOMtype = "ns4";
}

// make an array to store cached locations of objects called by fetch_object
var vBobjects = new Array();

// #############################################################################
// function to emulate document.getElementById
function fetch_object(idname, forcefetch)
{
	if (forcefetch || typeof(vBobjects[idname]) == "undefined")
	{
		switch (vbDOMtype)
		{
			case "std":
			{
				vBobjects[idname] = document.getElementById(idname);
			}
			break;

			case "ie4":
			{
				vBobjects[idname] = document.all[idname];
			}
			break;

			case "ns4":
			{
				vBobjects[idname] = document.layers[idname];
			}
			break;
		}
	}
	return vBobjects[idname];
}

// #############################################################################
// function to handle the different event models of different browsers
// and prevent event bubbling
function do_an_e(eventobj)
{
	if (!eventobj || is_ie)
	{
		window.event.returnValue = false;
		window.event.cancelBubble = true;
		return window.event;
	}
	else
	{
		eventobj.stopPropagation();
		eventobj.preventDefault();
		return eventobj;
	}
}



// function to register a menu for later initialization
function menu_register(controlid, nowrite, datefield)
{
	if (menu_usepopups)
	{
		menu_doregister(controlid, nowrite, datefield);
	}
}


// Main Javascript Initialization 

function pk_init()
{
	if (is_webtv)
	{
		return true;
	}
	switch (vbDOMtype)
	{
		case "std": imgs = document.getElementsByTagName("img"); break;
		case "ie4": imgs = document.all.tags("img");             break;
		default:    imgs = false;                                break;
	}
	if (imgs)
	{
		// set 'title' tags for image elements
		for (var i = 0; i < imgs.length; i++)
		{
			if (!imgs[i].title && imgs[i].alt != "")
			{
				imgs[i].title = imgs[i].alt;
			}
		}
	}

	// init registered menus
	if (menu_usepopups && menu_registered.length > 0)
	{
		for (i in menu_registered)
		{
			menu_init(menu_registered[i]);
		}

		// close all menus on mouse click
		document.onclick = menu_close;
	}
	
	return true;
}