




function $(){
	//by NioFox//
	var elements={};
	for (var i=0;i<arguments.length;i++){
		if (typeof arguments[i]=='string')
			elem=document.getElementById?document.getElementById(arguments[i]):document.all[arguments[i]];
		if(arguments.length==1)
			return elem;
		elements.push(elem);
	}
	return elements;
}



function swapImgOnOff(obj){
	imgUrl=obj.src.split('/');
	imgName=imgUrl[imgUrl.length-1];
	imgNameSplit=imgName.split('_');
	imgState=imgNameSplit[0];
	if(imgState=='off'){
		newState='on';
	} else if(imgState=='on'){
		newState='off';
	} else {
		newState=imgState;
	}
	newImgName=newState+'_'+imgNameSplit[1];
	newImgUrl='';
	for(i=0;i<(imgUrl.length-1);i++){
		newImgUrl=newImgUrl+imgUrl[i];
		if(i!=imgUrl.length-1){
			newImgUrl=newImgUrl+'/';
		}
	}
	obj.src=newImgUrl+newImgName;
}









function goToPage(url){
	window.location.href=url;
}
function showHide_subCategories(subCatId){
	for(i=0;i<8;i++){
		$('id_subCategoriesBox_wrapper_'+i).style.display='none';	
	}
	$(subCatId).style.display='inline';
}
function showHide_subCategories_bazaar(subCatId){
	for(i=0;i<4;i++){
		$('id_subCategoriesBox_wrapper_'+i).style.display='none';	
	}
	$(subCatId).style.display='inline';
}



function cngClassesAndBgImg(elem,imgId){
	elemClassName=elem.className;
//	alert(elemClassName);
	if(elemClassName=="span_listItem_NotSelected_out"){
		elem.className="span_listItem_NotSelected_over";
		$(imgId).style.backgroundImage='url(imgs/bg_imgs/23x1_db0000.gif)';
	} else if(elemClassName=="span_listItem_NotSelected_over"){
		elem.className="span_listItem_NotSelected_out";
		$(imgId).style.backgroundImage='url(imgs/bg_imgs/23x1_a2b7bc.gif)';		
	}
}
function cngAllClassesAndBgImg(elem,imgId,selectedItemNo){
//	alert(selectedItemNo);
//	alert(noOfFaqs);
	for(i=0;i<(noOfFaqs);i++){
		$('id_spantxt4Various_'+i).className='span_listItem_NotSelected_out';
		$('id_div_bgImg4various_'+i).style.backgroundImage='url(imgs/bg_imgs/23x1_a2b7bc.gif)';
	}
	elem.className="span_listItem_Selected";
	$(imgId).style.backgroundImage='url(imgs/bg_imgs/23x1_db0000.gif)';
	selectedItemNoTXT=(selectedItemNo+1);
	if(selectedItemNo<10){
		selectedItemNoTXT='0'+selectedItemNoTXT;
	}
	$('id_div_bgImg4variousTxt_numbers').innerHTML=selectedItemNoTXT;
	$('id_span_txt').innerHTML=faqsArray[selectedItemNo];
}

function cngClassesAndBgColors(elem,elemDateId){
	elemClassName=elem.className;
	if(elemClassName=="span_listItem_NotSelected_out"){
		elem.className="span_listItem_NotSelected_over";
		$(elemDateId).style.backgroundColor='#db0000';
	} else if(elemClassName=="span_listItem_NotSelected_over"){
		elem.className="span_listItem_NotSelected_out";
		$(elemDateId).style.backgroundColor='#a2b7bc';
	}
}
function cngAllClassesAndBgColors(elem,elemDateId,selectedItemDate,selectedItemNo){
	for(i=0;i<(noOfNews);i++){
		$('id_spantxt4Various_'+i).className='span_listItem_NotSelected_out';
		$('id_div_bgColor4various_'+i).style.backgroundColor='#a2b7bc';
	}
	elem.className="span_listItem_Selected";
	$(elemDateId).style.backgroundColor='#db0000';
//	alert(selectedItemDate);
	$('id_div_bgColor4variousTxt').innerHTML=selectedItemDate;
	$('id_span_txt').innerHTML=newsArray[selectedItemNo];
}



function enableSelectedSubCat(){
	$(id4selectedSubCat).style.display='';
//	alert('');
}
function disableSelectedSubCat(){
	$(id4selectedSubCat).style.display='none';
}










function sliderMove(direction){
	//alert($('id_div_gallery_wrapper').style.width);
	//alert($('id_div_gallery_wrapper').scrollLeft);
	//alert($('id_div_gallery_wrapper').style.left);

	containerSize=$('id_div_gallery_wrapper').style.width;
	containerSize=containerSize.split('px');
	containerSize=containerSize[0];
//	alert("containerSize: "+containerSize);
	
	
	boxSize=240;
	
	
	currentLeft=$('id_div_gallery_wrapper').style.left;
	currentLeft=currentLeft.split('px');
	currentLeft=currentLeft[0];
	if(currentLeft==null){
		currentLeft='0';
	}
//	alert("currentLeft: "+currentLeft);
	
	
	if(direction=='r'){
		if(containerSize>(currentLeft*3)){
//			alert('bigger');
//			alert("-"+(currentLeft+boxSize)+"px");
			$('id_div_gallery_wrapper').style.left="-"+(currentLeft+boxSize)+"px";
		}
	}
	
	if(direction=='l'){
		if(currentLeft<0){
//			alert('smaller');
//			alert((boxSize+(currentLeft))+"px");
			$('id_div_gallery_wrapper').style.left=(boxSize+(currentLeft))+"px";
		}
	}
	
//	$('id_div_gallery_wrapper').style.left='-240px';
	//alert(currentLeft);
}

