function PopUp(page, w, h) 
{
	window.open(page, "PopUp","toolbar=no,location=no,directories=no,status=no,menubar=yes,scrollbars=yes,resizable=yes,copyhistory=no,width="+w+",height="+h+",top=0,left=0");
}

function zoomify(image)
{
	x=image.src;
	while (x.indexOf('/')!=-1)
	x= x.substring(x.indexOf('/')+1,x.length);
	x=x.substring(0,x.indexOf('.'));
	x1=x.substring(0,x.indexOf('0'));
	x2=x.substring(x.indexOf('0')+1,x.length);
	x=x1+x2;
	PopUp('http://data.info.easiest.com/sre/jeanm/Zoomify.cfm?folder='+x,500,450);
}

function LargePopUp(imagepath, w, h){
	win_h = h + 50;
	win_w = w + 75;
	win_para = "toolbar=no,menubar=no,width=" + win_w + " ,height=" + win_h;
	popup=open("", "", win_para);
	popup.document.write('<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">\n');
	popup.document.write('<html>\n');
	popup.document.write('<head>\n');
	popup.document.write('<title>Good Thinking!</title>\n');
	popup.document.write('<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">\n');
	popup.document.write('</head>\n');
	popup.document.write('<body>\n');
	popup.document.write('<div align="center"><img src="' + imagepath + '" width="' + w + '" height="' + h + '" border="0" alt=""><br><br>\n');
	popup.document.write('<a href="javascript:close()" style="color: #000000; font-size: 12px;">Close</a></div>\n');
	popup.document.write('</body>\n');
	popup.document.write('</html>\n');
}

function show_section(id)
{
		$("#bs-content-tabs a").removeClass("bs-tab-selected")
		switch(id)
    {
        case ("bs-about-section"):
            $("#bs-about-section").show(); $("#bs-about-tab").addClass("bs-tab-selected");
            $("#bs-prizes-section").hide();
            $("#bs-faq-section").hide();
						$("#bs-official-section").hide();
            break;
        case ("bs-prizes-section"):
            $("#bs-prizes-section").show(); $("#bs-prizes-tab").addClass("bs-tab-selected");
            $("#bs-about-section").hide();
            $("#bs-faq-section").hide();
						$("#bs-official-section").hide();
            break;
        case ("bs-faq-section"):
            $("#bs-faq-section").show(); $("#bs-faq-tab").addClass("bs-tab-selected");
            $("#bs-about-section").hide();
            $("#bs-prizes-section").hide();
						$("#bs-official-section").hide();
            break;
				case ("bs-official-section"):
            $("#bs-official-section").show(); $("#bs-official-tab").addClass("bs-tab-selected");
            $("#bs-about-section").hide();
            $("#bs-prizes-section").hide();
						$("#bs-faq-section").hide();
            break;
    }
}

function createCatalogRequestLink(sourceCode)
{
	if (sourceCode)
		window.open("http://data.info.easiest.com/sre/jeanm/catalogrequestform.cfm?strSourceCode="+sourceCode);
	else
		window.open("http://data.info.easiest.com/sre/jeanm/catalogrequestform.cfm");
}

function gup(name)
{
  var regexS = "[\\?&]"+name+"=([^&#]*)";
  var regex = new RegExp( regexS );
  var tmpURL = window.location.href;
  var results = regex.exec( tmpURL );
  if( results == null )
    return "";
  else
    return results[1];
}

function switch_tabs(tab)
{
	switch (tab)
	{
		case (tab = "tab1"):
			$("#theme1").show();
			$("#theme2").hide();
			$("#theme3").hide();
			tab1_osrc = tab1_mosrc
			$("#tab1").attr("src",tab1_mosrc);
			tab2_osrc = tab2_src
			$("#tab2").attr("src",tab2_src);
			tab3_osrc = tab3_src
			$("#tab3").attr("src",tab3_src);
			break
		case (tab = "tab2"):
			$("#theme1").hide();
			$("#theme2").show();
			$("#theme3").hide();
			tab1_osrc = tab1_src
			$("#tab1").attr("src",tab1_src);
			tab2_osrc = tab2_mosrc
			$("#tab2").attr("src",tab2_mosrc);
			tab3_osrc = tab3_src
			$("#tab3").attr("src",tab3_src);
			break
		case (tab = "tab3"):
			$("#theme1").hide();
			$("#theme2").hide();
			$("#theme3").show();
			tab1_osrc = tab1_src
			$("#tab1").attr("src",tab1_src);
			tab2_osrc = tab2_src
			$("#tab1").attr("src",tab2_src);
			tab3_osrc = tab3_mosrc
			$("#tab1").attr("src",tab3_mosrc);
			break
	}
}

function chgDetails(div)
{
	if (divshown != "--") $("#"+divshown).hide();
	if (div != "--") $("#"+div).show();
	divshown = div;
}

function chgDetailImg(imgD, imgL) 
{
	$("#ColorDetail").attr("src",imgD);
  $("#ColorLabel").attr("src",imgL);
	LabeloSrc = $("#ColorLabel").attr("src");
	$("#ColorLabel").attr("src",imgL);} 

function refreshParent(catID)
{
	var catLink = "engine.cfm?iCatID=" + catID;
	window.opener.document.location.href = catLink;
	return false;
}