
function emailPage(intPageID)
{
	var intLeft = (window.screen.width - 340) / 2;
	var intTop = (window.screen.height - 460) / 2;
	var features = "height=460,width=340,left=" + intLeft + ",top=" + intTop;
	window.open("/Pedagog/templates/EmailPage.aspx?id=" + intPageID, null, features);
}

function printPage() 
{
	var da = (document.all) ? 1 : 0;
	
	var printArea = document.getElementById("PrintArea");
	
	if(printArea == null && da) 
		printArea = document.all.PrintArea;
	
	if(printArea) 
	{
		var sStart = "<html><head><link rel=\"stylesheet\" type=\"text/css\" href=\"/Pedagog/styles/print.css\"></head><body onload=\"if(window.print)window.print();\">";
		sStop = "</body></html>";
		
		var s = sStart + printArea.innerHTML;

		var w = window.open('about:blank','printWin','width=650,height=440,scrollbars=yes,toolbar=yes');
		wdoc = w.document;
		wdoc.open();
		wdoc.write(s);
		wdoc.writeln( sStop );
		wdoc.close();
	}
}


function RenderPlayerObjectLinks(intProductID){

    var strURL = "/Global/Templates/Asx.aspx?ProductID=" + intProductID;
    var strHTML = "";
    if ((navigator.userAgent.indexOf("MSIE") > -1) && (navigator.userAgent.indexOf("Opera") == -1))
    strHTML += "<div class=\"fullscreenlink\"><a href=\"#\" onclick=\"openFullScreen();return false;\">&Ouml;ppna i fullsk&auml;rm &raquo;</a></div>";
    strHTML += "<div class=\"windowlink\"><a href=\"" + strURL + "&.asx\">300 kbps &raquo;</a></div>";
    strHTML += "<div class=\"windowlink\"><a href=\"" + strURL + "&Bitrate=1200&.asx\">1200 kbps &raquo;</a></div>";
    //strHTML += "<div class=\"maillink\"><a href=\"#" + intProductID + "\" onclick=\"emailClip();return false;\">Tipsa en v&auml;n &raquo;</a></div>";
    return strHTML;
    
}

function RenderRadioPlayerObjectLinks(intProductID){

    var strURL = "/Global/Templates/Asx.aspx?ProductID=" + intProductID;
    var strHTML = "";
    strHTML += "<div class=\"windowlink\"><a href=\"" + strURL + "&.asx\">32 kbps &raquo;</a></div>";
    strHTML += "<div class=\"windowlink\"><a href=\"" + strURL + "&Bitrate=64&.asx\">64 kbps &raquo;</a></div>";
    //strHTML += "<div class=\"maillink\"><a href=\"#" + intProductID + "\" onclick=\"emailClip();return false;\">Tipsa en v&auml;n &raquo;</a></div>";
    return strHTML;
    
}

function openFullScreen(){
    var objMediaPlayer = document.getElementById("playerobjectembed");
    if(objMediaPlayer != null){
        if(objMediaPlayer.playState){
		    if (objMediaPlayer.playState == 3){
			    objMediaPlayer.fullScreen = 'true';
            }
        }
    }
}
/* MB Javascript*/
function restore(name){

	if(document.swapHash){
		
		var image1 = document.swapHash[name + "a"];
		var image2 = document.swapHash[name + "b"];
		var linkItem = document.swapHash[name + "c"];
			
		linkItem.style.color = linkItem.oColor;
		linkItem.style.textDecoration = linkItem.oTextDecoration;
		image1.src = image1.oSrc;
		image2.src = image2.oSrc;
			
	}
}

function swap(name, color, textDecoration, swapImage1, swapImage2) {
	if (document.images && document.links){
	
		var linkItem, image1, image2;
			
		image1 = document.images[name + "a"];
		image2 = document.images[name + "b"];
		linkItem = document.getElementById(name + "c");
		
		image1.oSrc = image1.src;
		image2.oSrc = image2.src;
		linkItem.oColor = linkItem.style.color;
		linkItem.oTextDecoration = linkItem.style.textDecoration;
		
		if(!document.swapHash){
			document.swapHash = new Array();
		}
		
		document.swapHash[name + "a"] = image1;
		document.swapHash[name + "b"] = image2;
		document.swapHash[name + "c"] = linkItem;	
		
		linkItem.style.color = color;
		linkItem.style.textDecoration = textDecoration;
		image1.src = swapImage1;
		image2.src = swapImage2;				
	}
}
/*End MB javascript*/
