﻿/**
 * Yleiset functiot
 *
 * 29.05.2007
 *
 * ver. 1.0
 */
 
     function ViewEmbed(strParams)
    {
        var ref = "viewer.aspx";

        if (strParams!=""){
            ref=ref + "?" + strParams;
        }
        parent.frames['frmEmbed'].location=ref;
    }

    function OpenPanoWindow(strPage,lngWidth, lngHeight,lngTop, lngLeft, strTitle){

	    var strHeight   =",height=";
	    var strWidth    =",width=";
	    var strTop      = ",top=";
	    var strLeft     = ",left=";
	    var screenY     = 0;
	    var screenX     = 0;
	    var top         = 0;
	    var left        = 0;	
   	
                
	    if(navigator.appName == "Microsoft Internet Explorer") {
		    screenY = window.screen.availHeight-38;
		    screenX = window.screen.availWidth-10;
	    }
	    else {
		    screenY = window.screen.availHeight;
		    screenX = window.screen.availWidth;
	    }
        
        if (lngWidth==0){
            lngWidth=screenX;
            lngHeight=screenY;
        }
                
	    strWidth = strWidth + lngWidth;
	    strHeight = strHeight + lngHeight;
	    
	    top = (screenY-lngHeight)/3;
	    strTop = strTop + top;
	    
	    left = (screenX-lngWidth)/2;
	    strLeft = strLeft + left;	
	    
	    //strTop = strTop + top;
	    //strLeft = strLeft + left
        
        //strPage = "http://www.ympyrakuvat.fi/galleria/" + strPage + "/index.htm";
        
	    var strOpenParams = "' resizable=yes, status=no, toolbar=no, scrollbars=no,location=no,menubar=no,directories=no" + strTop +  strLeft +  strHeight + strWidth + "'";
	    var win = window.open(strPage, 'Panoraama', strOpenParams, true);
	    win.window.focus();

    }
    
    function OpenTourWindow(strPage, lngWidth, lngHeight,lngTop, lngLeft, strTitle ){

        var strHeight   =",height=" + lngHeight ;
        var strWidth    =",width=" + lngWidth ;
        var strTop      = ",top=";
        var strLeft     = ",left=";
	    var screenY     = 0;
	    var screenX     = 0;   
	    var top         = 0;
	    var left        = 0;
	    	     
	    if(navigator.appName == "Microsoft Internet Explorer") {
		    screenY = window.screen.availHeight-38;
		    screenX = window.screen.availWidth-10;
	    }
	    else {
		    screenY = window.screen.availHeight;
		    screenX = window.screen.availWidth;
	    }    
	    
	    top = (screenY - lngHeight)/3;
	    strTop = strTop + top;
	    
	    left = (screenX - lngWidth)/2;
	    strLeft = strLeft + left;	    

    var strOpenParams = "' resizable=yes, status=yes, toolbar=no, scrollbars=yes,location=no,menubar=no,directories=no" + strHeight + strWidth + strTop +  strLeft + "'";
	window.open(strPage, strTitle, strOpenParams, true);

}
