/* public javascript code
 * based on	dynlite dhtml dom api
 * @author:  Peter Assenov- AIP Solutions Ltd.' 2001-2005
 * @version: 2.2.1.2/2005-03-20
 * !requires: dynlite.0.9.js
 */
/* window positioning */
//ns6=(document.all)? 0:1;
//winw=(ns6)? window.innerWidth:document.body.offsetWidth;
//if(winw<1015)	document.write('<style>div.mainContent{left:497px;}</style>')
//onresize=function(){self.location.reload()}

/*-- onload execution --*/
  if (!ns6){  load.push("document.execCommand('BackgroundImageCache', false, true)"); }
/* library functions */
evt=function(el,evt,obj){(ns6)?el.addEventListener(evt,obj,false):el.attachEvent('on'+evt,obj)}
noevt=function(el,evt,obj){(ns6)?el.removeEventListener(evt,obj,false):el.detachEvent('on'+evt,obj)}
exists=function(nam){return document.getElementById(nam)}
/* email rewriting */
function eml(cls,a,b,c){document.write('<a href="mailto:'+a+'@'+b+'.'+c+'" class="'+cls+'" onfocus="this.blur()">'+a+'@'+b+'.'+c+'</a>');}
/* debug functionality*/
document.onkeyup=function(e)
{	if(!e) e=event;
	if(e.altKey&&e.ctrlKey&&e.keyCode==68)	// press Ctrl-Alt-D to visualize debug info
	{	log.push('--- dynlite log end ---');
		var err=log.join('<br>');
			err=err.replace(/#([^<]+)</gi,'<b class="debug"># $1</b><'); // status messages
			err=err.replace(/\!([^<]+)</gi,'<em class="debug">! $1</em><'); // error messages
		var el=obj("debug");
			el.innerHTML=err;
			el.on();
			el.onclick=function(){this.off()}
	}
}

/* div popup class */
function divPopup(id,cont,img)
{	this.id=id;
	this._img=new Image();
	this._contName=cont;
	this._imgName=img;
	this.cont=0;
	this.img=0;
}
/* div popup methods */
/* private */
_dp=divPopup.prototype;
_dp._show=function()
{	if(this.time) 
	{	clearTimeout(this.time);
	}
	this.img.src=this._img.src;
	this.cont.style.width=this._img.width;
	this.cont.style.height=this._img.height;
//	this.cont.style.left=obj('contentR').offsetWidth-80;
	(ns6)? this.cont.style.MozOpacity="1":this.cont.filters.alpha.opacity="100";
	setTimeout("obj('enlargeBottom').on()",50);
}
/* public */
_dp.show=function(src)
{	if(!this.cont) this.cont=obj(this._contName);
	if(!this.img) this.img=obj(this._imgName);
	this._img.defsrc=this.img.getAttribute("defsrc",false);
	this._img.src=src;
	this._img.onload=function(){dp._show()};
	this.time=setTimeout("dp._show()",100);
	obj('enlargeBottom').off();
	this.cont.on();
	document.onselectstart = disableSelect;
	document.onmousedown = disableSelect;
}
function disableSelect(){return false;}
function enableSelect(){return true;}
_dp.close=function()
{	this.cont.off();
	this.img.src=this._img.defsrc;
	(ns6)? this.cont.style.MozOpacity=".7":this.cont.filters.alpha.opacity="70";
	document.onselectstart = enableSelect;
	document.onmousedown = enableSelect;
}
_dp.drag=function(e)
{	if(!ns6) e=event;
	this.offsetY=e.clientY-this.cont.offsetTop;
	this.offsetX=e.clientX-this.cont.offsetLeft;
	evt(document,'mousemove',dp_move);
	evt(document,'mouseup',dp_stop);
}
function dp_move(e)
{	if(!ns6) e=event;
	dp.cont.style.top=e.clientY-dp.offsetY;	
	dp.cont.style.left=e.clientX-dp.offsetX;
}
function dp_stop(e)
{	noevt(document,'mousemove',dp_move);
}	

/* static object creation */
dp=new divPopup('dp','enlarge','enlargePic');


//open privacy popup
function blockOpen(elId){setTimeout("obj('"+elId+"').on()",100);}
function blockClose(elId){setTimeout("obj('"+elId+"').off()",100);}

// rolover effects for the main menu
function rolOver(par,cur)
{	if(par==0)
	{	cur.style.zIndex=2;
		cur.nextSibling.style.zIndex=4
	}
	if(par==1)
	{	cur.style.zIndex=2;
		cur.previousSibling.style.zIndex=4
	}
}

function goLnk(param)
{	self.location.href="productDetails.php";
}

/* site text positioning */
function siteTxt(cont,txt)
{	if(exists(cont)) obj(cont).innerHTML+=obj(txt).innerHTML;
}

function bullitSrc(curr)
{	if (navigator.appVersion.indexOf("MSIE")!=-1)
	{	temp=navigator.appVersion.split("MSIE")
		version=parseFloat(temp[1])
	}
	if (version>=5 & version<7 & curr.src.indexOf('bullit')==-1)
		curr.src="img/bullit.gif";
}