// JavaScript Document

function showFlashPlayer(item)
{
	var obj=document.getElementById(item);

   var visible=(obj.style.display!="none")
   
   if (visible) 
   {
	 obj.style.display="none";
	 $('#imageBox').remove(); 
	 $('#video').append($('<div>').attr('id','imageBox'));
   } 
   else 
   {
		obj.style.display="block";
      	
		var flashvars = {};
		flashvars.width = "480";
		flashvars.height = "360";
		flashvars.enablejs = "true";
		//flashvars.file = "../_flash/how_to_use.flv";
		flashvars.file = "../_flash/cvdemo.mp4";
		flashvars.autostart = "true";
		var params = {};
		params.allowfullscreen = "true";
		params.allowscriptaccess = "always";
		var attributes = {};
		swfobject.embedSWF("../_flash/mediaplayer.swf", "imageBox", "480", "360", "9.0.0", false, flashvars, params, attributes);
   }
}

// toggle function 
function divToggle(item) {
   obj=document.getElementById(item);
   visible=(obj.style.display!="none")
   key=document.getElementById("x" + item);
   if (visible) {
     obj.style.display="none";
   } else {
      obj.style.display="block";
   }
}

// show function
function showDiv(item) {
  obj=document.getElementById(item);
	key=document.getElementById("x" + item);
	obj.style.display="block";
   
}

// hide function
function hideDiv(item) {
  obj=document.getElementById(item);
	key=document.getElementById("x" + item);
	obj.style.display="none";
}


function showTooltipp(id) {
    tt = document.getElementById('tt' + id);
    tt.style.display = 'block';
}

function hideTooltipp(id) {
    tt = document.getElementById('tt' + id);
    tt.style.display = 'none';
}

// popup Window - thanks to forss, very nice script, indeed.
function openWindow(sURL, iWidth, iHeight, sResizable, sScrollbars) {
    var detailStyle = ",resizable=";
    detailStyle += sResizable ? sResizable : "no";
    detailStyle += ",scrollbars=";
    detailStyle += sScrollbars ? sScrollbars : "0";

    posLeft = (screen.width - iWidth) / 2;
    posTop = (screen.height - iHeight) / 2;
    hPopup = window.open(sURL, 'EDIT' + Math.round(Math.random() * 10000), 'left=' + posLeft + ',top=' + posTop + ',width=' + iWidth + ',height=' + iHeight + detailStyle);
    hPopup.moveTo((screen.width - iWidth) / 2, (screen.height - iHeight) / 2);
    hPopup.focus();
}

