function addLoadEvent(func)
{
	var oldonload = window.onload;
	if (typeof window.onload != 'function') {
		window.onload = func;
	} 
	else {
		window.onload = function() {
			oldonload();
			func();
		}
	}
}
//----------------------------- Disable right click -------------------------------
document.oncontextmenu = new Function("return false");
addLoadEvent(disablerightclick);
var clickmessage="All rights reserved - bkjewelry.co.il";
function disableclick(e) {
if (document.all) {
	if (event.button==2||event.button==3) {
			alert(clickmessage);
			return false;
	}
}
else if (document.layers) {
	if (e.which == 3) {
		alert(clickmessage);
		return false;
	}
}
else if (document.getElementById){
		if (e.which == 3) {
			e.preventDefault();
      		e.stopPropagation();
			alert(clickmessage);
			return false;
		}
	}
}
function associateimages(){
	for(i=0;i<document.images.length;i++)
		document.images[i].onmousedown=disableclick;
}
function disablerightclick()
{
	if (document.all)
		document.onmousedown=disableclick
	else if (document.getElementById)
		document.onmouseup=disableclick
	else if (document.layers)
		associateimages()
}
//----------------------------- Disable right click End -------------------------------
function OpenWindow(nav)
{
	var w = 600;
	var h = 500;
	var winl = (screen.width - w) / 2;
	var wint = (screen.height - h) / 2;
	winprops = "top=" + wint + ", left=" + winl + ", resizable=no, scrollbars=no, width="+ w + ", height="+ h;
	window.open(nav, "sendtofriend", winprops);
}

function fixPNG(myImage, url) 
{
	var arVersion = navigator.appVersion.split("MSIE")
	var version = parseFloat(arVersion[1])
    if ((version >= 5.5) && (version < 7) && (document.body.filters)) 
    {
       var imgID = (myImage.id) ? "id='" + myImage.id + "' " : ""
	   var imgClass = (myImage.className) ? "class='" + myImage.className + "' " : ""
	   var imgTitle = (myImage.title) ? 
		             "title='" + myImage.title  + "' " : "title='" + myImage.alt + "' "
	   var imgStyle = "display:inline-block;" + myImage.style.cssText
	   var strNewHTML = "<span " + imgID + imgClass + imgTitle
                  + " style=\"" + "width:" + myImage.width 
                  + "px; height:" + myImage.height 
                  + "px;" + imgStyle + ";"
                  + "filter:progid:DXImageTransform.Microsoft.AlphaImageLoader"
                  + "(src=\'" + myImage.src + "\', sizingMethod='scale');\"><img src='images/spacer.gif' style='width:" + myImage.width + "px; height:" + myImage.height + "px; cursor:pointer;' onclick=\"window.location.href='" + url + "'\" /></span>"
	   myImage.outerHTML = strNewHTML  
    }
}