﻿// JScript File
<!--//
function ChangeImg(ObjId,ImgSrc)
{
    //alert(ImgSrc);
    document.getElementById(ObjId).src = ImgSrc;
}


//get the page name and send it to changePage function
function SetPage()
{
	var URL = unescape(location.href)	// get current URL in plain ASCII
	var xstart = URL.lastIndexOf("/") + 1
	var xend = URL.length
	var PageUrl = URL.substring(xstart,xend)				
	PageUrl = PageUrl.toLowerCase();
	//check if has ?
	var sign = PageUrl.indexOf("?");

	if(sign != -1)
	{											
		PageUrl = PageUrl.substring(0,sign); 
	}
	
	PageUrl = PageUrl.substring(0,(PageUrl.length-5))
	//alert(PageUrl);

    if (PageUrl == "news"){changePage(0);}
    else if (PageUrl == "bio"){ changePage(1);}
    else if (PageUrl == "music"){ changePage(2);}
    else if (PageUrl == "gallery"){ changePage(3);}
    else if (PageUrl == "videos"){ changePage(4);}
    else if (PageUrl == "magazines"){ changePage(5);}
    else if (PageUrl == "articles"){ changePage(6);}
    else if (PageUrl == "viewarticle"){ changePage(6);}
    else if (PageUrl == "questions"){ changePage(7);}
    else if (PageUrl == "shows"){ changePage(8);}    
    else if (PageUrl == "contact"){ changePage(9);}
    else if (PageUrl == "editprofile"){ changePage(10);}
    else if (PageUrl == "signin"){ changePage(11);}
    else if (PageUrl == "downloadlogin"){ changePage(12);}
    else if (PageUrl == "download"){ changePage(12);}  
    else if (PageUrl == "downloadedit"){ changePage(12);}
    else if (PageUrl == "starcast"){ changePage(12);}    
    else if (PageUrl == "seker"){ changePage(13);}
                  
}


//send to flash object the active page
function changePage(newPage)
{
    //alert(newPage);
	//check if Flash object exists
	if (window.document.smallBanner) 
	{
	    //alert(newPage);
		//document.getElementById('flash_container').setVariable('page', newPage);
		window.document.smallBanner.SetVariable("page", newPage);
	}
}

function CountMediaViews(MediaId,MediaType)
{
    //alert("MediaId = " + MediaId + " MediaType = " + MediaType);
	document.getElementById('RSIFrame').location.href = "Include/CountFunction.asp?type=" + MediaType +"&objid=" + MediaId;  
}

function CountCommercialViews()
{
	top.RSIFrame.location.href = "http://ad.msn.co.il/html.ng/s=smile&affiliate=nnt&ft=bburl&params.styles=img.url&tile=1";  
}

function ChangeBG(ObjID,ClassName)
{
    if(document.getElementById(ObjID).className != 'SelectedNews')
    {
        document.getElementById(ObjID).className = ClassName;
    }
}

function Goto(href)
{
        window.location.href=href;
}
-->

