var dontChange = false;
//var embed = '<object CLASSID="clsid:02BF25D5-8C17-4B23-BC80-D3488ABDDC6B" width="500" height="280" CODEBASE="http://www.apple.com/qtactivex/qtplugin.cab">' +
//                '<param name="src" value="__filepath__">'+
//                '<param name="autoplay" value="false">'+
//                '<param name="controller" value="true">'+
//                '<param name="scale" value="aspect">'+
//                '<param name="bgcolor" value="000000">'+
//                '<param name="moviename" value="Suite">'+
//                '<param name="SaveEmbedTags" value="true">'+
//                '<embed src="__filepath__" width="500" height="280" autoplay="false" bgcolor="000000" SaveEmbedTags="true" scale="aspect" controller="true" pluginspage="http://www.apple.com/quicktime/"></embed>'+
//                '</object>'+
//                '<div style="float:right; margin-top:10px; cursor:pointer;" onclick="closeOverlay()"><img src="/images/jquery/lightbox/closelabel.gif" /></div> ';
//              
var embed = '<object width="500" height="260" classid="clsid:02BF25D5-8C17-4B23-BC80-D3488ABDDC6B" codebase="http://www.apple.com/qtactivex/qtplugin.cab#version=6,0,2,0">' +
                '<param name="src" value="__filepath__">'+
                '<param name="controller" value="true"/>'+
                '<param name="moviename" value="pleinpotVR"/>'+
                '<param name="scale" value="aspect"/>'+
                '<param name="autoplay" value="false"/>'+
                '<param name="cache" value="false"/>'+
                '<param name="bgcolor" value="000000"/>'+
                '<param name="SaveEmbedTags" value="true">'+
                '<embed width="500" height="260" src="__filepath__" pluginspage="http://www.apple.com/quicktime/download/" controller="true" moviename="pleinpotVR" scale="aspect" autoplay="false" cache="false" bgcolor="000000" saveembedtags="true"/> '+
                '</object>';//+
                //'<div style="float:right; margin-top:10px; cursor:pointer;" onclick="closeOverlay()"><img src="/images/jquery/lightbox/closelabel.gif" /></div> ';
              


function pop(url, name, w, h, rs, sb, mn, st, oth) 
{
    var resize = ((rs) ? "resizable="+rs+"," : "");
    var scroll = ((sb) ? "scrollbars="+sb+"," : "");
    var menu = ((mn) ? "toolbar="+mn+",location="+mn+",menubar="+mn+"," : "");
    var sts = ((st) ? "status="+st+"," : "");
  
     var popupWin = window.open(url, name, resize + scroll + menu + sts + "width=" + w + ",height=" + h + " " + oth);
     if (document.layers) 
     {
          popupWin.focus();
     }
}



$(document).ready(function()
{
    $(".onoff").each(function()
    {
        var src = $(this).attr("src");
        if(src.indexOf("_on.gif") != -1)
        {
            $(this).removeClass('onoff');
        }
    })
    $(".onoff").hover(function()
    {
        var src = $(this).attr("src");
        var src = src.replace("_off.gif", "_on.gif");
        $(this).attr("src", src);
        
        
    }, function()
    {
        var src = $(this).attr("src");
        var src = src.replace("_on.gif", "_off.gif");
        $(this).attr("src", src);
    })
    
    
});

function launchQTVR(qtvrPath)
{
//   // alert("here");
//    //alert($('body').outerHeight());
//    $('#blackout').css('filter', 'alpha(opacity=80)');
//    $("#blackout").css('height', $('body').outerHeight());
//    $("#fakecon").css('height', $('body').outerHeight());
//    
//    $("#blackout").fadeIn(600, function()
//    {
//        $("#fakecon").css('visibility', 'visible');
//        $("#virtualcon").css('visibility', 'visible');
//        var left = ($("#blackout").outerWidth()/2) - ($("#virtualcon").outerWidth()/2);
//        $("#virtualcon").css('left', left);
//        embed = embed.replace('__filepath__', qtvrPath);
//        embed = embed.replace('__filepath__', qtvrPath);
//        $("#virtualcon").html(embed);
//    });
////        embed = embed.replace('__filepath__', qtvrPath);
////        embed = embed.replace('__filepath__', qtvrPath);
////        alert(embed);
////        $("body").html(embed);
//   
//   
////    $("#blackout").css('visibility', 'visible');
////    $("#fakecon").css('visibility', 'visible');
////    $("#virtualcon").css('visibility', 'visible');
////    var left = ($("#blackout").outerWidth()/2) - ($("#virtualcon").outerWidth()/2);
////    $("#virtualcon").css('left', left);
////    embed = embed.replace('__filepath__', qtvrPath);
////    embed = embed.replace('__filepath__', qtvrPath);
////    $("#virtualcon").html(embed);
//    
}

function closeOverlay()
{
    
    $("#blackout").fadeOut(200);
    $("#fakecon").css('visibility', 'hidden');
    $("#virtualcon").html("");
    $("#virtualcon").css('visibility', 'hidden');
}