/* 
	Glitz  
	@author: alex.smoljanovic@thewebshop.ca 
*/

var sHov = '-h',
	ndomb=false;
function sNav(o,b){
	if(!o.className || ndomb)return;
	try{
		if(o.className.indexOf(sHov)==-1 && b)
			o.className = o.className + sHov;
		else if(o.className.indexOf(sHov)>=0 && !b)
			o.className = o.className.substr(0,o.className.lastIndexOf(sHov));
	}catch(e){
		if(e.toString().indexOf("TypeError")>=0){
			//no properties, dom is broke
			ndomb=true;
		}
	}
}
function cache_res(){ 
	var args = cache_res.arguments;
	document.imageArray = new Array(args.length);
	var buff="";
	for(var i=0; i<args.length; i++){
		document.imageArray[i] = new Image();
		document.imageArray[i].src = args[i];
		buff += args[i];
	}
}
function cache_all(){
	if(navigator.appName.indexOf("Internet Explorer")==-1)return;
	cache_res("img/menu_r.gif",
			  "img/menu_r-h.gif",
			  "img/menu_g.gif",
			  "img/menu_g-h.gif",
			  "img/menu_rr.gif",
			  "img/menu_rl.gif",
			  "img/menu_gr.gif",
			  "img/menu_gl.gif");
	
}

function SetupC2(){
	try{cache_all();}catch(e){;}
	init();
}

function findObj(theObj, theDoc){
	var p, i, foundObj;
	if(!theDoc) theDoc = document;
	if( (p = theObj.indexOf("?")) > 0 && parent.frames.length) {
		theDoc = parent.frames[theObj.substring(p+1)].document;
		theObj = theObj.substring(0,p);
	}
	if(!(foundObj = theDoc[theObj]) && theDoc.all) foundObj = theDoc.all[theObj];
		for (i=0; !foundObj && i < theDoc.forms.length; i++) 
			foundObj = theDoc.forms[i][theObj];
	for(i=0; !foundObj && theDoc.layers && i < theDoc.layers.length; i++) 
		foundObj = findObj(theObj,theDoc.layers[i].document);
	if(!foundObj && document.getElementById) foundObj = document.getElementById(theObj); 
	return foundObj;
}


function search_activity( el, blurred )
{
	if( blurred )	
	{
		el.className = 'txt-inactive';	
		if( el.value.replace(/ /g, '' ) == '' )
			el.value = 'search';
	}
	else
	{
		el.className = 'txt-active';	
		if( el.value == 'search' )
			el.value = '';
	}
}