﻿// JScript File

// player Ad start
var idint,idbig,idcount,seconds;

function showAd(src){
    
//	idint = setTimeout(hideAd,10000);
//	document.getElementById("hide").innerHTML = '<img src="../Images/Ad/hide.gif" width="42" height="12" border="0" align="center" onClick="hideAd()" style="cursor:pointer" />';
//	document.getElementById("ads").innerHTML = '<iframe id="audioFrm" name="audioFrm" src="'+src+'" width=234 height=60 hspace=0 vspace=0 frameborder=0 marginheight=0 marginwidth=0 scrolling=no></iframe>';
}

function hideAd(){
//	clearInterval(idint);
//	document.getElementById("hide").innerHTML = "";
//	document.getElementById("ads").innerHTML = "";
}



function hideAdBig(){
	clearInterval(idbig);
	var passed=false;
	document.getElementById("bigads").innerHTML = "";
	
	
    if(navigator.appName.indexOf("Microsoft") != -1)
    {
	   if(window.document["simplevideostreaming"]) {
		window.document["simplevideostreaming"].SetVariable("startPlayer", "true");
		passed=true;
	   }
	}
	else
	{ 
	    if(document.simplevideostreaming) {
	      if(document.simplevideostreaming.SetVariable){
	 	   document.simplevideostreaming.SetVariable("startPlayer", "true");
	 	   passed=true;
	 	  }
	 	}
	}
	if(!passed)
	{
	sendEvent('playitem', 0);  
	}
}

function showAdBig(){
    seconds=10
    clearInterval(idbig);
	idbig = setTimeout(hideAdBig,10000);
	
	clearInterval(idcount);
	document.getElementById("bigads").innerHTML = '<div style="width:553px;height:340px;background-color:#000000;"><iframe style="background-color:#000000;" width="300px" height="250px" src="http://www.indiaglitz.com/bads/medRectIFrame.asp" id="Frame1"  hspace="0" vspace="0" frameborder="0" marginheight="0" marginwidth="0" scrolling="no"></iframe><div><br><center> <span style="color:white;" ><b>Your video will play in <span id=countdisplay></span>&nbsp;secs <b></span></center>';
	display()
}

 
 

function display(){ 
    if(document.getElementById("countdisplay"))
    {
    document.getElementById("countdisplay").innerHTML=seconds 
    } 
    seconds-=1 
    idcount=setTimeout("display()",1000) 
} 

// player Ad end

function sendEvent(typ,prm) { 
    if(thisMovie("jwplayer"))
    {
       if(thisMovie("jwplayer").sendEvent)
       {
          thisMovie("jwplayer").sendEvent(typ,prm); 
       }
    }
}

function thisMovie(movieName) {
    if(navigator.appName.indexOf("Microsoft") != -1) {
		return window.document[movieName];
	} else {
		return document[movieName];
	}
}

function PausePlayer()
{
    var passed=false;
    if(navigator.appName.indexOf("Microsoft") != -1)
    {
        if(window.document["simplevideostreaming"]) {
		     window.document["simplevideostreaming"].SetVariable("pausePlayer", "true");
	 	     passed=true;
	      }
	}
	else
	{   
	    if(document.simplevideostreaming)
	    {
	      if(document.simplevideostreaming.SetVariable)
	      {
 		     document.simplevideostreaming.SetVariable("pausePlayer", "true");
 		     passed=true;
 		  }
 		}  
	}
	if(!passed)
	{
	sendEvent('playpause');
	}
	
}


function PlayPlayer()
{
    var passed=false;
    if(navigator.appName.indexOf("Microsoft") != -1)
    {
      if(window.document["simplevideostreaming"]) {
		window.document["simplevideostreaming"].SetVariable("startPlayer", "true");
		passed=true; 
	  }
	}
	else
	{  
	    if(document.simplevideostreaming) 
	    {
	       if(document.simplevideostreaming.SetVariable)
	       {
	 	     document.simplevideostreaming.SetVariable("startPlayer", "true");
	 	     passed=true; 
	 	   }
	    }
	}
    if(!passed)
	{
	    sendEvent('playpause');
	}
}