﻿var InternetExplorer = navigator.appName.indexOf("Microsoft") != -1;

function GetElement (ElementName)
{
	x = InternetExplorer ? document.all[ElementName] : document.getElementById(ElementName);
	return x;
}

function PopSite(Url)
{
	if (InternetExplorer == true)
	{
		var auto = open('about:blank','Educ','toolbar=0, scrollbars=yes');
		auto.moveTo(0,0);
	    auto.resizeTo(800,screen.availHeight);  
	    auto.navigate(Url);
	}
	else
	{
		var auto = open(Url,'Educ','toolbar=0, scrollbars=yes, width=150, height=100');
	    auto.resizeTo(800,screen.availHeight);  
	    auto.moveTo(0,0);
	}
}

function PopSiteWithWidth(Url,PaegWidth) {
    if (InternetExplorer == true) {
        var auto = open('about:blank', 'Educ', 'toolbar=0, scrollbars=yes');
        auto.moveTo(0, 0);
        auto.resizeTo(PaegWidth, screen.availHeight);
        auto.navigate(Url);
    }
    else {
        var auto = open(Url, 'Educ', 'toolbar=0, scrollbars=yes, width=150, height=100');
        auto.resizeTo(PaegWidth, screen.availHeight);
        auto.moveTo(0, 0);
    }
}

function PopMap(MapName) {
    //alert("http://www.modiin.muni.il/ModiinMap/LoadModiinMapWithZoomToObject02.aspx?" + MapName);
    if (InternetExplorer == true) {
        var auto = open('about:blank', 'Educ', 'toolbar=0, scrollbars=yes');
        auto.moveTo(0, 0);
        auto.resizeTo(screen.availWidth, screen.availHeight);
        auto.navigate("http://www.modiin.muni.il/ModiinMap/LoadModiinMapWithZoomToObject02.aspx?" + MapName );
    }
    else {
        var auto = open("http://www.modiin.muni.il/ModiinMap/LoadModiinMapWithZoomToObject02.aspx?" + MapName, 'Educ', 'toolbar=0, scrollbars=yes, width=150, height=100');
        auto.resizeTo(screen.availWidth, screen.availHeight);
        auto.moveTo(0, 0);
    }
}

function SelfNavigate(Url)
{ 
    self.location = Url;
//	if (InternetExplorer == true)
//	{
//	    self.location = Url;
        //window.navigate (Url);
//	}
//	else
//	{
//	    self.location=Url;
        //self.open (Url);
//	}
}

function SetDefaultPage() {
	if (InternetExplorer == true) {
        theobj = document.anchors[0];
	    theobj.style.behavior = 'url(#default#homepage)';
	    theobj.setHomePage(document.location.href);
	}
	else
	{
	}
}

function AddPageToFevorit() {
    if (InternetExplorer == true) {
       window.external.AddFavorite(document.location.href, document.title);
    }
    else {
        addBookmark(document.location.href, document.title);
    }
}

function addBookmark(title, url) {
    if (window.sidebar) {
        window.sidebar.addPanel(title, url, "");
    } else if (document.all) {
        window.external.AddFavorite(url, title);
    } else if (window.opera && window.print) {
        return true;
    }
}


function LoadPaymentPage() {
    PopSite("https://www.mybills.co.il/step2.asp?slOrgType=127&slPayType=1");
    }



    function LoadAudioFlowPlayer() {


        $f("a.FlowPlayerAudio", "/modiinwebsite/flowplayer3/flowplayer3.swf", {

            clip: {

                autoPlay: true,

                // optional: when playback starts close the first audio playback 
                onBeforeBegin: function() {
                $f("FlowPlayerAudio").close();
                }
            },

            // disable controls from each player
            plugins: {
                audio: {
                    url: '/modiinwebsite/flowplayer3/flowplayer.audio.swf'
                },
                controls: {
                    fullscreen: false,
                    height: 30
                }
            }
        });

    }

    function CreateFlashObject(MenuName, ElementName, Width, Height) {


        m_Menu1 = GetElement(ElementName);
//        m_Menu1.innerHTML = '<OBJECT classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=6,0,40,0" WIDTH="280" HEIGHT="85" id="myMovieName">' +
//                            '<PARAM NAME=movie VALUE="' + MenuName + '">\r\n' +
//                            '<PARAM NAME=quality VALUE=high>' +
//                            '<PARAM NAME=bgcolor VALUE=#FFFFFF>';
//
//        return;
        
        m_Menu1.innerHTML = '<OBJECT classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=5,0,0,0" WIDTH="' + Width + '" HEIGHT="' + Height + '" id="myFlash1" ALIGN="" VIEWASTEXT> \r\n' +
			  '<PARAM NAME="movie" VALUE="' + MenuName + '">\r\n' +
			  '<PARAM NAME="quality" VALUE="high">' +
			  '<PARAM NAME="bgcolor" VALUE="#FFFFFF">' +
			  '<PARAM NAME="Menu" VALUE="0">' +
			  '<PARAM NAME="Scale" VALUE="ExactFit">' +
			  '<EMBED src="' + MenuName + '" Scale="exactfit" quality="high" Menu="0" bgcolor="#FFFFFF" WIDTH="' + Width + '" HEIGHT="' + Height + '" NAME="myFlash1" ALIGN="" TYPE="application/x-shockwave-flash" PLUGINSPAGE="http://www.macromedia.com/go/getflashplayer"></EMBED>\r\n' +
			  '</OBJECT>'; 
			  //alert("!");
        //	alert(m_Menu1.innerHTML);
        //m_Menu1.innerHTML;
    }

    function CreateFlashObjectWithBGColor(MenuName, ElementName, Width, Height, BGColor) {
        m_Menu1 = GetElement(ElementName);
        m_Menu1.innerHTML = '<OBJECT classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=5,0,0,0" WIDTH="' + Width + '" HEIGHT="' + Height + '" id="myFlash2" ALIGN="" VIEWASTEXT> \r\n' +
			  '<PARAM NAME="movie" VALUE="' + MenuName + '">\r\n' +
			  '<PARAM NAME="quality" VALUE="high">' +
			  '<PARAM NAME="Menu" VALUE="0">' +
			  '<PARAM NAME="Scale" VALUE="ExactFit">\r\n' +
			  '<PARAM NAME="BGColor" VALUE="' + BGColor + '">\r\n' +
			  '<EMBED src="' + MenuName + '" Scale="ExactFit" quality="high" bgcolor="' + BGColor + '" WIDTH="' + Width + '" HEIGHT="' + Height + '" NAME="myFlash2" ALIGN="" TYPE="application/x-shockwave-flash" PLUGINSPAGE="http://www.macromedia.com/go/getflashplayer"></EMBED>\r\n' +
			  '</OBJECT>';
    }

    function loadEvents() {
        //alert("!");
        SelfNavigate('/ModiinWebSite/EventBoard.aspx?PageID=439_385');
    }

    function loadSummerEvents() {
        //alert("!");
        SelfNavigate('/ModiinWebSite/EventBoard.aspx?PageID=439_385');
    }

    function loadMainEvents() {
        //alert("!");
        SelfNavigate('/modiinwebsite/ChannelArticleNews.aspx?PageID=2_295&id=724');
    }
    
    function loadMainMitog() {
        //alert("!");
        SelfNavigate('/modiinwebsite/ChannelArticleNews.aspx?PageID=2_295&id=766');
    }
    
    