function confirm_delete(strkey)
{
	var txt = strings[strkey];
	var ans = confirm(txt);
	if(ans)
		return true;
	return false;
}

function getIphotoVersion(desc) {
	var matches = desc.match(/\d/g);
	return matches.join('.');
}

$(function(){
var hasIphoto = false;
if (navigator.userAgent.match('Safari') &&
  navigator.mimeTypes &&
  navigator.mimeTypes.length > 0) {
var iphoto = navigator.mimeTypes['application/photo'];
if (iphoto)
  hasIphoto = true;
}

$(".cd_photo").click(function(){return confirm_delete('PH_CONFIRM_DELETE');});
$(".cd_sb").click(function(){return confirm_delete('SB_CONFIRM_DELETE');});
$(".fullpage_wnd").click(function(){window.open(this.href,'mywin',
	'left=20,top=20,width=1020,height=600,toolbar=1,resizable=0,scrollbars=1');return false});
$(".popup_wnd").click(function(){window.open(this.href,'mypopup',
	'left=20,top=20,width=640,height=450,toolbar=1,resizable=0,scrollbars=1');return false});
var nm=window.name;
if(nm == 'mywin' || nm == 'mypopup'){$("button.help_close").css("visibility", "visible");}
if(nm == 'mypopup'){
	$("#top").css("display", "none"); $("#topcontrol").css("display", "none");
    $("#doc").css("width", "620px"); $("#page").css({width: "550px", marginLeft: "20px"});
    $("#footer").css("width", "520px"); $("#bottom").css("display", "none");
    }
$(".dropdown").click(function(){
		var id=this.id;
        if(id != '')
        {
        	$(".ddm").css({top:"-999px"});
	        $(".ddm").hide();
            var x=$(this).offset();
            var tn=$("#top_nav").offset();
            var ry=x.top+20
            var rx=x.left-tn.left-8;
            $("#m_"+id).css({left:rx+"px", top:ry+"px"});
			$("#m_"+id).slideToggle(150);
            //$("#m_"+id+" ul").css({display: "block"});
        	return false;
        }
        return true;
	});
$(".ddm").hide();
$("#home_div").click(function(){window.location='/index.html';});
if(hasIphoto){
	$(".iphoto").each(function(){this.href=this.href.replace(/http:\/\//, 'photo://', this.href);});
}
$(document).bind('click',function(){$(".ddm").hide();});
});


