/******* GLOBALS [BEGIN] *******/
var is_opera = /opera\/9/i.test(navigator.userAgent);
var is_gecko = /gecko/i.test(navigator.userAgent);
var is_ie    = /MSIE/.test(navigator.userAgent);
/******* GLOBALS [END] *******/
/*function Cursor () {
	
	var xCoordinate;
	var yCoordinate;
	
	var truebody = function (){
		if(!window.opera && document.compatMode && document.compatMode!="BackCompat"){
			return document.documentElement;
		}
		else{
			return document.body;
		}
	}
	
	this.updateCursorPosition = function (DOMEvent) {
		if (is_ie) {
			xCoordinate = event.clientX + truebody().scrollLeft;
			yCoordinate = event.clientY + truebody().scrollTop;
		} else {
			xCoordinate = DOMEvent.pageX > 0 ? DOMEvent.pageX : 0;
			yCoordinate = DOMEvent.pageY > 0 ? DOMEvent.pageY : 0;
		}
		
		//truebody().innerHTML = "X: " + this._x + " Y: " + this._y + "<br>" + truebody().innerHTML;
	}
	
	this.getX = function () {
	   return xCoordinate;
	}
	
	this.getY = function () {
	   return yCoordinate;
	}
}*/

/*function Image (path){
	this._path = path;
	this._enabledLoading;
	this._preloadImage;
}

function Popup (popupObject){
	
	var obj = popupObject;
	var eventTimeout;
	var offsetx = 20;
	var offsety = 20;
	var wasOver = false;
	
   var cursorObj = new Cursor();
	if(!is_ie){
		document.captureEvents(Event.MOUSEMOVE);
	}
	document.onmousemove = cursorObj.updateCursorPosition;
	
	this.image = new Image();
	
	obj.style.display = "none";
	obj.style.zIndex = "999";
	
	this.getObject = function () {
		return obj;
	}
	
	this.getObjectStyle = function () {
		return obj.style;
	}
	
	this.getCursorObject = function () {
		return cursorObj;
	}
	
	this.setOffsetFromCursor = function (xOffset, yOffset) {
		offsetx = xOffset;
		offsety = yOffset;
	}
	
	this.setDimension = function (objWidth, objHeight) {
		this.style.height = objHeight;
		this.style.width = objWidth;
	}
	
	this.setContent = function (htmlSource) {
		obj.innerHTML = htmlSource;
	}
	
	this.show = function (htmlSource) {
		if(arguments.length != 0 && (typeof(arguments[0]) == typeof(true) || typeof(arguments[1]) == typeof(true))){
			wasOver = true;
		}
		if(wasOver == true){
			obj.style.top = cursorObj.getY() + offsety + "px";
			obj.style.left = cursorObj.getX() + offsetx + "px";
			obj.style.display = "block";
			
			if(arguments.length == 1 && typeof(arguments[0]) == typeof("string")){
				if(obj.innerHTML != htmlSource){
					obj.innerHTML = htmlSource;
				}
			}
		}
	}
	
	this.showWithTimeout = function (timeout, htmlSource) {
		if(eventTimeout){
			clearTimeout(eventTimeout);
			eventTimeout = 0;
		}
		
		tmpfunc = this.show;
		if(arguments.length == 1 && typeof(arguments[0]) == typeof("string")){
			tmpfunc(arguments[0],true);
		}
		else if(arguments.length == 2){
			eventTimeout = setTimeout("tmpfunc('" + htmlSource + "', true);", timeout);
		}
		else{
			eventTimeout = setTimeout("tmpfunc(true);", timeout);
		}
	}
	
	this.hide = function () {
		obj.style.display = "none";
		wasOver = false;
		this._y = "200px";
		this._x = "-500px";
	}
	
	this.hideWithTimeout = function (timeout) {
		if(eventTimeout){
			clearTimeout(eventTimeout);
			eventTimeout = 0;
		}
		tmpfunc = this.hide;
	   eventTimeout = setTimeout("tmpfunc();", timeout);
	}
}
*/
//var popupObj = new Popup(document.getElementById('popup'));
//alert(document.getElementById('preview_div').id);

function setCVisible()
{
	document.getElementById('popup').className='crvisible';
	//document.getElementById(pip).style.z-index='1000';
	/*var inc=0;
	var alltags=document.all? document.all : document.getElementsByTagName("div");
	for (i=0; i<alltags.length; i++)
	{
		if (alltags[i].className=='crvisible')
		alltags[i].className='crhidden';
	}
	for (i=0; i<alltags.length; i++)
	{
		if (alltags[i].className=='crhidden'){
			alltags[i].className='crvisible';
			alltags[i].style.top = 150 + (index * 30);
			alltags[i].style.left = 480;
		}
	}*/
}

/*
function setCVisiblePip(pip)
{
	document.getElementById(pip).className='crvisible';
}*/

function setCHiddenPip(pip){
	
	document.getElementById(pip).className='crhidden';
	document.getElementById(pip).innerHtml='';
	//document.getElementById(pip).style.z-index='0';
}

function setCHidden()
{
	javascript:document.getElementById('popup').className='crhidden';
	document.getElementById('popup').innerHtml='';
	//document.getElementById('popup').style.z-index='0';
}
/////////////

function setCVisibleComplect()
{
	javascript:document.getElementById('complect').className='crvisible';
	//document.getElementById('popup').style.z-index='1100';
}
function setCHiddenComplect()
{
	javascript:document.getElementById('complect').className='crhidden';
	document.getElementById('complect').innerHtml='';
	//document.getElementById('popup').style.z-index='0';
}

/*var cursorObj = new Cursor();
	if(!is_ie){
		document.captureEvents(Event.MOUSEMOVE);
	}
	document.onmousemove = cursorObj.updateCursorPosition;*/

function pop_offset (pop, ox,oy){

	var mouse_x = cursorObj.getX();
	var mouse_y = cursorObj.getY();
	//pop.style.top  = mouse_y + oy + "px";
	//pop.style.left = mouse_x + ox + "px";
	if (is_ie){
   	pop.style.top  = document.body.scrollTop  + 'px';
    //pop.style.left = document.body.scrollLeft +  'px';		
		
	}
	else{
	pop.style.top  = window.scrollY + "px";	
	//pop.style.left = window.scrollX + "px";	
	}
	
	
	
	
}
