﻿hs.graphicsDir = 'highslide/graphics/';
hs.outlineType = 'rounded-white';
hs.align = 'center';
hs.transitions = ['expand', 'crossfade'];
hs.outlineType = 'rounded-white';
hs.fadeInOut = true;
//hs.dimmingOpacity = 0.75;

function openDDL(id) {
	obj = document.getElementById('ddlDiv' + id);
	if (obj) {
		obj.style.display = 'block';
	}
}

function closeDDL(id) {
	obj = document.getElementById('ddlDiv' + id);
	if (obj) {
		obj.style.display = 'none';
	}
}

function toggleDDL(id) {
	obj = document.getElementById('ddlDiv' + id);
	if (obj) {
		if (obj.style.display == 'none') {
			obj.style.display = 'block';
		}
		else {
			obj.style.display = 'none';
		}
	}
}

function selectDDL(id, objItem, field) {
	closeDDL(id);
	for (i = 0; el = document.forms[0].elements[i]; i++) {
		if (el.type == "text" && el.name.indexOf(field) > -1) {
		    if (navigator.appVersion.indexOf("MSIE") != -1)
		        el.value = objItem.innerText;
		    else
		        el.value = objItem.textContent; 
		}
	}
}

function changebackg(div) {
    document.getElementById('door' + div).style.backgroundImage = "url(images/backon.jpg)";
}
function changebackgr(div) {
    document.getElementById('door' + div).style.backgroundImage = "url(images/backreg.jpg)";
}
function changebackgbasket(div) {
    document.getElementById('P_' + div).style.backgroundImage = "url(images/basketbacks.jpg)";
}
function changebackgrbasket(div) {
    document.getElementById('P_' + div).style.backgroundImage = "url(images/basketback.jpg)";
}
function showProductDescription(id,cat) {
  
	var obj1 = document.getElementById('product_name_'+id);
	var obj2 = document.getElementById('product_name');
	obj2.innerHTML = obj1.innerHTML;
	
	var obj1 = document.getElementById('product_description_'+id);
	var obj2 = document.getElementById('product_description');

	if (navigator.appVersion.indexOf("MSIE") != -1)
	    obj2.innerText = obj1.innerText;
	else
	    obj2.textContent = obj1.textContent;	

//	var obj = document.getElementById('product_url');
//	if (cat != 'hand') {
//	    obj.href = 'Product_in.aspx?id=' + id;
//	}
//	else  {
//	    obj.style.display = 'none';
//	    document.getElementById('catbutton').style.display = 'none';
//	}
}
function showProductImage(image) {
    obj = document.getElementById('gallery_big_image');
    obj_url = document.getElementById('gallery_big_url');
    if (obj) {
        obj.src = 'Thumbnail.ashx?image=images/page_images/' + image + '&w=300&h=320&cp=1&rs=1&rb=1';
        obj_url.href = 'Thumbnail.ashx?image=images/page_images/' + image + '&w=1000&h=800&cp=1&rs=0&rb=1';
    }
}

function SlidePanel() {
        var slide_top_def = 240;
        var slide_top = parseInt(document.getElementById("SlidePanel").offsetTop);
        var slide_h = parseInt(document.getElementById("slide_bottom").offsetTop);
        var slide_bottom = slide_top + slide_h;
        var max_bottom = parseInt(document.getElementById("max_bottom").offsetTop) - 240;
        var _top = getScrollY();  //document.documentElement.scrollTop;

        if (slide_top >= slide_top_def) {
            if (_top + slide_h < max_bottom) {
                document.getElementById("SlidePanel").style.top = _top + "px";
            }
            else
                document.getElementById("SlidePanel").style.top = slide_top_def + "px";
        }
        else {
            document.getElementById("SlidePanel").style.top = slide_top_def + "px";
        }
}

function getScrollY() 
{
	scrollY = 0;
	if (typeof window.pageYOffset == "number") {
		scrollY = window.pageYOffset;
	} else if (document.documentElement && document.documentElement.scrollTop) {
		scrollY = document.documentElement.scrollTop;
	} else if (document.body && document.body.scrollTop) {
		scrollY = document.body.scrollTop;
	} else if (window.scrollY) {
		scrollY = window.scrollY;
	}
	return scrollY;
}

function getInnerHeight() 
{
	height = 0;
	if (window.innerHeight) {
		height = window.innerHeight - 18;
	} else if (document.documentElement && document.documentElement.clientHeight) {
		height = document.documentElement.clientHeight;
	} else if (document.body && document.body.clientHeight) {
		height = document.body.clientHeight;
	}
	return height;
}

function printpr() 
{ 
	var OLECMDID = 7; 
	/* OLECMDID values: 
	* 6 - print 
	* 7 - print preview 
	* 1 - open window 
	* 4 - Save As 
	*/ 
	var PROMPT = 1; // 2 DONTPROMPTUSER  
	var WebBrowser = '<OBJECT ID="WebBrowser1" WIDTH=0 HEIGHT=0 CLASSID="CLSID:8856F961-340A-11D0-A96B-00C04FD705A2"></OBJECT>'; 
	document.body.insertAdjacentHTML('beforeEnd', WebBrowser);  
	WebBrowser1.ExecWB(OLECMDID, PROMPT); 
	WebBrowser1.outerHTML = "";
}

function showMap(id) {
	obj = document.getElementById('map' + id);

	for (i = 1; i <= 3; i++) {
		if (i != id) {
			document.getElementById('map' + i).style.display = 'none';
		}
	}

	if (obj) {
		if (obj.style.display == 'block') {
			obj.style.display = 'none';
		}
		else {
			obj.style.display = 'block';
		}
	}
}

function hideMap(id) {
	obj = document.getElementById('map' + id);
	if (obj) {
		obj.style.display = 'none';
	}
}

function selectScrollTab(n, category) {
        if (n == 1) {
            if (category == "out") {
                document.getElementById('product_but' + 1).className = 'product_but' + n + '_over';
                document.getElementById('product_but2').className = 'product_but2';
                document.getElementById('product_but3').className = 'product_but3';
                document.getElementById('scroll_' + 1).style.display = 'block';
                document.getElementById('scroll_' + 2).style.display = 'none';
                document.getElementById('scroll_' + 3).style.display = 'none';
            }
            else if (category == "in") {
                document.getElementById('product_but' + 1).className = 'product_but' + 1 + '_over';
                document.getElementById('product_but2').className = 'product_but2';
                document.getElementById('product_but3').className = 'product_but3';
                document.getElementById('scroll_' + 2).style.display = 'block';
                document.getElementById('scroll_' + 1).style.display = 'none';
                document.getElementById('scroll_' + 3).style.display = 'none';
            }
        }
        else if (n == 2) {
            if (category == "out") {
                document.getElementById('product_but' + n).className = 'product_but' + n + '_over';
                document.getElementById('product_but1').className = 'product_but1';
                document.getElementById('product_but3').className = 'product_but3';
                document.getElementById('scroll_' + 2).style.display = 'block';
                document.getElementById('scroll_' + 1).style.display = 'none';
                document.getElementById('scroll_' + 3).style.display = 'none';
            }
            else if (category == "in") {
                document.getElementById('product_but' + n).className = 'product_but' + 2 + '_over';
                document.getElementById('product_but1').className = 'product_but1';
                document.getElementById('product_but3').className = 'product_but3';
                document.getElementById('scroll_' + 1).style.display = 'block';
                document.getElementById('scroll_' + 2).style.display = 'none';
                document.getElementById('scroll_' + 3).style.display = 'none';
            }
        }
        else if (n == 3) {
        if (category == "out") {
            document.getElementById('product_but' + n).className = 'product_but' + n + '_over';
            document.getElementById('product_but1').className = 'product_but1';
            document.getElementById('product_but2').className = 'product_but2';
            document.getElementById('scroll_' + 3).style.display = 'block';
            document.getElementById('scroll_' + 1).style.display = 'none';
            document.getElementById('scroll_' + 2).style.display = 'none';
        }
        else if (category == "in") {
            document.getElementById('product_but' + n).className = 'product_but' + 3 + '_over';
            document.getElementById('product_but1').className = 'product_but1';
            document.getElementById('product_but2').className = 'product_but2';
            document.getElementById('scroll_' + 3).style.display = 'block';
            document.getElementById('scroll_' + 2).style.display = 'none';
            document.getElementById('scroll_' + 1).style.display = 'none';
        }
        }
}
function selectScrollTabold(id) {
    for (i = 1; i <= 2; i++) {
        if (id == 1) {
            document.getElementById('product_but1').className = 'product_but1_over';
            document.getElementById('product_but2').className = 'product_but2';
            document.getElementById('scroll_' + id).style.display = 'block';
        }
        else {
            document.getElementById('product_but1').className = 'product_but1';
            document.getElementById('product_but2').className = 'product_but2_over';
            document.getElementById('scroll_' + id).style.display = 'none';
        }
    }
}

function business_showresult(txt) {
        destination.push('result');
        script_name = 'showresult.aspx';
        ajax_req = 'txt=' + txt;
        cache.push(ajax_req);
        getAjaxRequest();
        if (txt.length > 1 ) {
            document.getElementById('result').className = 'result2';
        }
        else {
            document.getElementById('result').className = 'result';
        }
}
function selectresult(txt) {
    //alert(txt);
    document.getElementById('search').value = txt;
    document.getElementById('result').className = 'result';
    StartSearch();
}
function showdiv(txt) {
    //var a = txt.length;
    //alert(txt.length);
    //var a = setTimeout('', 1000);
    
}
function changecolor(id, color) {
    if (color == 1) {
        document.getElementById(id).className = 'rptresult2';
    }
    else {
        document.getElementById(id).className = 'rptresult';
    }

}
function changeColornew(image) {
    for (var i = 1; i < 4; i++) {
        document.getElementById("img" + i).style.backgroundImage = "url(images/big" + i + image + ".jpg)";
        document.getElementById("bigproduct").style.backgroundImage = "url(images/back" + image + ".jpg)";
        if (i == image)
            document.getElementById("image" + i).src = "images/" + i + i + ".jpg";
        else
            document.getElementById("image" + i).src = "images/" + i + ".jpg";
    }
}
function closeresult() {
    document.getElementById('result').style.display = 'none';
}
function funcshownews(id) {
    document.getElementById('textfull_' + id).style.display = 'block';
    document.getElementById('hidetext_' + id).style.display = 'block';
    document.getElementById('showtext_' + id).style.display = 'none';
}
function funchidenews(id) {
    document.getElementById('textfull_' + id).style.display = 'none';
    document.getElementById('hidetext_' + id).style.display = 'none';
    document.getElementById('showtext_' + id).style.display = 'block';
}
function funcshowfaq(id) {
    document.getElementById('open_' + id).style.display = 'block';
    document.getElementById('close_' + id).style.display = 'none';
    //document.getElementById('details_' + id).style.display = 'block';
    $('#details_' + id).slideDown('slow');
}
function funchidefaq(id) {
    document.getElementById('open_' + id).style.display = 'none';
    document.getElementById('close_' + id).style.display = 'block';
    //document.getElementById('details_' + id).style.display = 'none';
    $('#details_' + id).slideUp('slow');
}
function funcshowfaq2(id) {
    document.getElementById('open2_' + id).style.display = 'block';
    document.getElementById('close2_' + id).style.display = 'none';
    //document.getElementById('details2_' + id).style.display = 'block';
    $('#details2_' + id).slideDown('slow');
}
function funchidefaq2(id) {
    document.getElementById('open2_' + id).style.display = 'none';
    document.getElementById('close2_' + id).style.display = 'block';
    //document.getElementById('details2_' + id).style.display = 'none';
    $('#details2_' + id).slideUp('slow');
}
function funcshowfaq3() {
    document.getElementById('open_m').style.display = 'block';
    document.getElementById('close_m').style.display = 'none';
    //document.getElementById('details_m').style.display = 'block';
    $('#details_m').slideDown('slow');
}
function funchidefaq3() {
    document.getElementById('open_m').style.display = 'none';
    document.getElementById('close_m').style.display = 'block';
    //document.getElementById('details_m').style.display = 'none';
    $('#details_m').slideUp('slow');
}
var tmp;
function showMenu(id) {
    document.getElementById('door_' + id).style.display = 'block';
//    if (tmp != id) {
//        $('#door_' + id).slideDown('slow');
//    }
//    else {
//        document.getElementById('door_' + id).style.display = 'block';
//    }
//    tmp = id;
}
function hideMenu(id) {
    document.getElementById('door_' + id).style.display = 'none';
    //$('#door_' + id).slideUp('slow');
}
function showPic(id,alt) {
    document.getElementById('ctl00_ContentPlaceHolder1_image_big').src = 'images/page_images/' + id;
    document.getElementById('ctl00_ContentPlaceHolder1_image_big').alt = alt;
}
function funcshowmanage(id) {
    document.getElementById('manage_close_' + id).style.display = 'block';
    document.getElementById('manage_open_' + id).style.display = 'none';
    $('#manage_' + id).slideDown('slow');
}
function funchidemanage(id) {
    document.getElementById('manage_close_' + id).style.display = 'none';
    document.getElementById('manage_open_' + id).style.display = 'block';
    $('#manage_' + id).slideUp('slow');
    //document.getElementById('manage_' + id).style.display = 'none';
}