	/*
	* File: common.js
	*/

	$(document).ready(function () {
		
		$("#popupLoginLink").click(function () {
			$("#popup_login").slideDown("fast");
		});

		$("#popupLoginClose").click(function () {
			$("#popup_login").slideUp("fast");
		});
		
		$("#divePhotoGuidePortal").html($("#divePhotoGuide").html());
	});
	
	var location_hash = document.location.hash.length > 0 ? document.location.hash.substr(1) : "";
	
	////
	// shows big product image
	//
	function showImage(imgFileName)
	{
		if (imgFileName != "" && (imgElm = document.getElementById('box_image')))
		{
			imgFile = '/images/products/b/' + imgFileName;

			if (imgFile != "")
			{
				imgElm.style.backgroundImage = 'url(/img/clear.gif)';
				imgElm.style.backgroundImage = 'url(' + imgFile + ')';
			}
		}

		return true;
	} // showBigImage()
	
	
	function hide()
	{
		if(hide.arguments.length > 0)
		{
			var el = hide.arguments[0];
			el = (typeof(el) == "string") ? document.getElementById(el) : el;
			if(el && typeof(el) == "object") el.style.display = "none";
		}
		return false;
	}
	
	function show()
	{
		var display = "block";
		if(show.arguments.length > 0)
		{
			if(show.arguments.length > 1)
			{
				display=show.arguments[1];
			}
			var el = show.arguments[0];
			el = (typeof(el) == "string") ? document.getElementById(el) : el;
			if(el && typeof(el) == "object")el.style.display = display;
		}
		return false;
	}
	
	function remove()
	{
		if(remove.arguments.length > 0)
		{
			var el = remove.arguments[0];
			el = (typeof(el) == "string") ? document.getElementById(el) : el;
			if(el && typeof(el) == "object") el.parentNode.removeChild(el);
		}
		return false;
	}
	
	function include(filename)
	{
		var scripts = document.getElementsByTagName("script");
		for(var i in scripts) if(scripts[i].src == filename) return false;
		
    var html_doc = document.getElementsByTagName('head').item(0);
    var js = document.createElement('script');
    js.setAttribute('language', 'javascript');
    js.setAttribute('type', 'text/javascript');
    js.setAttribute('src', filename);
    html_doc.appendChild(js);
    return false;
	}//include