
// JScript File
    function Checkcookie()
    {
         var Flag =readCookie('Showpopup');
        if (Flag == "false")
        {
        
           //Show popup.
           var count = parseInt(readCookievalue('Popupcount'));
           if(count==5)
           {
            createCookie('Popupcount',1,365);
            initbox();
           }
           else if(count<5)
           {
           count = count + 1;
           createCookie('Popupcount',count,365);
           }
           else
           {
           createCookie('Popupcount',1,365);
           }
            return true;
        }
        else if (Flag == "true")
        {
            return true;
        }
        else
        {
            createCookie('Showpopup','false',365);
            createCookie('Popupcount',1,365);
            initbox();
            //alert(Flag);
            return true; 
        }
        
    }
    
    
    
    //Read cookie name.    
    function readCookie(name) 
    {
	    var nameEQ = name + "=";
	
	    var ca = document.cookie.split(';');
	    for(var i=0;i < ca.length;i++) 
	    {
		    var c = ca[i];
		    while (c.charAt(0)==' ') c = c.substring(1,c.length);
		    if (c.indexOf(nameEQ) == 0) 
		    return c.substring(nameEQ.length,c.length);
	    }
	    return null;
    }
    
    function readCookievalue(name) 
    {
	    var nameEQ = name + "=";
	
	    var ca = document.cookie.split(';');
	    for(var i=0;i < ca.length;i++) 
	    {
		    var c = ca[i];
		    while (c.charAt(0)==' ') c = c.substring(1,c.length);
		   
		    if (c.indexOf(nameEQ) == 0) 
		     if(c.substring(nameEQ.length,c.length))
		     {
		     
		      return c.substr(nameEQ.length,c.length);
		     }
	    }
	    return null;
    }
       
    //Create cookie name with value(i.e.Showpopup=true).
    function createCookie(name,value,days)
     {
	    if (days)
	    {
	    var date = new Date();
		date.setTime(date.getTime()+(days*24*60*60*1000));
		var expires = "; expires="+date.toGMTString();
	    }
	    else var expires = "";
	    document.cookie = name+"="+value+expires+"; path=/";
	}

  
   
   //Change cookies value.
   function Changecookievalue()
    {
        var val;
        var chk=document.getElementById("chkpopup_feature");
        val = chk.checked;
        if (val)
        {  
           createCookie('Showpopup',val,365); 
        }
       dismissbox();
    }
    
   function closewindow()
   {
        dismissbox();
   }





// Drop-in content box- By Dynamic Drive
// For full source code and more DHTML scripts, visit http://www.dynamicdrive.com
// This credit MUST stay intact for use

//Specify rate of display (1/freq)
var freq=0;

var random_num=Math.floor(Math.random()*freq)
if (random_num==0)
//window.onload=initbox


var ie=document.all
var dom=document.getElementById

var ns4=document.layers
var calunits=document.layers? "" : "px"

var bouncelimit=32 //(must be divisible by 8)
var direction="up"

function initbox(){

if (!dom&&!ie&&!ns4)
return
crossobj=(dom)?document.getElementById("dropin").style : ie? document.all.dropin : document.dropin
scroll_top=(ie)? truebody().scrollTop : window.pageYOffset
crossobj.top=scroll_top-250+calunits
crossobj.visibility=(dom||ie)? "visible" : "show"
dropstart=setInterval("dropin()",50)
}

function dropin(){
scroll_top=(ie)? truebody().scrollTop : window.pageYOffset
if (parseInt(crossobj.top)<115+scroll_top)
crossobj.top=parseInt(crossobj.top)+40+calunits
else{
clearInterval(dropstart)
bouncelimit=32;
bouncestart=setInterval("bouncein()",50)
}
}

function bouncein(){

crossobj.top=parseInt(crossobj.top)-bouncelimit+calunits
if (bouncelimit<0)
bouncelimit+=8

bouncelimit=bouncelimit*-1

if (bouncelimit==0){
clearInterval(bouncestart)
}
}

function dismissbox(){
if (window.bouncestart) clearInterval(bouncestart)
crossobj.visibility="hidden"
}

function truebody(){
return (document.compatMode && document.compatMode!="BackCompat")? document.documentElement : document.body
}




   
function FlashMovie(iwidth,iheight,sfile,obj)
{

var flash_obj,flash_vars;

//sfile = 'http://212.227.103.196:600/flash/popup-new.swf';
sfile = '../flash/' + sfile;
//alert(sfile);
flash_obj = flash_obj + "<table cellpadding=5 cellspacing=0>";
flash_obj = flash_obj + "<tr>";
flash_obj = flash_obj + "<td>";

flash_obj ="<object classid=   'clsid:d27cdb6e-ae6d-11cf-96b8-444553540000'codebase='http://fpdownload.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=6,0,0,0' width='" + iwidth + "' height='" + iheight + "' id='Clip1' align='middle'>";
flash_obj = flash_obj + "<param name='allowScriptAccess' value='sameDomain'>";
flash_obj = flash_obj + "<param name='movie' value='" + sfile + "'>" ;
flash_obj = flash_obj + "<param name='FlashVars' value='" + "" + "'>" ;

flash_obj = flash_obj + "<param name='loop' value='false' >";
flash_obj = flash_obj + "<param name='wmode' value='transparent' />";
flash_obj = flash_obj + "<param name='menu' value='false'>";
flash_obj = flash_obj + "<param name='quality' value='high>";
flash_obj = flash_obj + "<param name='salign' value='t'>";
flash_obj = flash_obj + "<param name='bgcolor' value='#ffffff'>";
flash_obj = flash_obj + "<embed src='" + sfile + "' FlashVars='" + "" + "' loop='false' menu='false' wmode='transparent'  quality='high' salign='t' bgcolor='#ffffff' width='" + iwidth + "' height='" + iheight + "' name='Clip1' align='middle' allowScriptAccess='sameDomain' type='application/x-shockwave-flash' pluginspage='http://www.macromedia.com/go/getflashplayer' >";
flash_obj = flash_obj + "</object>";

flash_obj = flash_obj + "</td>";
flash_obj = flash_obj + "</tr>";
flash_obj = flash_obj + "</table>";

document.getElementById(obj).innerHTML = flash_obj;
}


function WinOpen(url)
{
window.open(url,'restWin','width=840px,height=620px,left=0,top=0,resizable=yes,status=yes,scrollbars=yes');
return false;
}
