// Top menu
document.write('<div class="yellowNormText" id="topLinks"><table width="750" border="0" align="center" cellpadding="0" cellspacing="0"><tr><td width="649"><a href="/news/" class="yellowTextLink">खबर-संसार</a> । &nbsp;<a href="/entertainment/" class="yellowTextLink">मनोरंजन</a> । &nbsp;<a href="/sports/" class="yellowTextLink">खेल-संसार</a> । &nbsp;<a href="/miscellaneous/" class="yellowTextLink">विविध</a> । &nbsp;<a href="/religion/" class="yellowTextLink">धर्म-संसार</a> । &nbsp;<a href="/samayik/" class="yellowTextLink">सामयिक</a> । &nbsp;<a href="/portalcms/channels/default.aspx" class="yellowTextLink">सेवाएँ</a> । &nbsp;<a href="http://hindi.webdunia.com/photogallery/default.aspx" class="yellowTextLink">फोटो गैलेरी</a></td><td width="130"><div align="right"><img src="images/icon_swstik.jpg" /> <a href="http://hindi.webdunia.com/religion/religion/hindu/ramcharitmanas/" class="orangeLink">श्रीरामचरितमानस</a> <img src="images/icon_swstik.jpg" /></div></td></tr></table></div>');

// Font +-
function changeFontSize(x){
	setFont(x);
}
function setFont(x){
	wbdUtils.cookies.Set("bdFntSz",x );
	loadFont(x)
}
function loadFont(x){
	if(!x) x = wbdUtils.cookies.Get("bdFntSz");
	if(x && document.body){
		var size =  8+ (parseInt(x)*2)
		document.body.style.fontSize = size + "pt";
		//document.write("<style type='text/css' rel='stylesheet'>#midContentBox {font-size: " + size + "pt!important;} </style>");
	}
}
//window.onload = loadFont

//Cookie 
var wbdUtils = {};
wbdUtils.cookies = {};
wbdUtils.cookies.Set = function( name, value, expires, path, domain, secure ) {
    var today = new Date();
    today.setTime( today.getTime() );
    if ( expires ){
        expires = expires * 1000 * 60 * 60 * 24;
    }
    var expires_date = new Date( today.getTime() + (expires) );
    document.cookie = name + "=" +escape( value ) + 
        ( ( expires ) ? ";expires=" + expires_date.toGMTString() : "" ) + 
        ( ( path ) ? ";path=" + path : "" ) + 
        ( ( domain ) ? ";domain=" + domain : "" ) +
        ( ( secure ) ? ";secure" : "" );
}
wbdUtils.cookies.Get = function ( name ) {
    var start = document.cookie.indexOf( name + "=" );
    var len = start + name.length + 1;
    if ( ( !start ) && ( name != document.cookie.substring( 0, name.length ) ) ){
        return null;
    }
    if ( start == -1 ) {
        return null;
    }
    var end = document.cookie.indexOf( ";", len );
    if ( end == -1 ) { 
        end = document.cookie.length;
    }
    return unescape( document.cookie.substring( len, end ) );
}
wbdUtils.cookies.Delete = function ( name, path, domain ) {
    document.cookie = name + "=" +
        ( ( path ) ? ";path=" + path : "") +
        ( ( domain ) ? ";domain=" + domain : "" ) +
        ";expires=Thu, 01-Jan-1970 00:00:01 GMT";
}

loadFont();
//-----------------------------------------//

var wbdUrlList = {'www.webdunia.com':'http://hindi.webdunia.com','msn.webdunia.com':'http://hindi.webdunia.com','webdunia.com':'http://hindi.webdunia.com','discussion.webdunia.com':'http://hindi.webdunia.com'};

var urlPrefix = wbdUrlList[window.location.hostname] || ""
function OpenGallery()
{
//    if(window.location.hostname=='www.webdunia.com')
//        openWindowCenterScreen("http://hindi.webdunia.com/PhotoGallery/PhotoGalleryImageWindow.aspx?IId=" + ImageId  + "&GId=" + GalleryId + "&Idx=" + Index + "&Link=" + Link,"gallery",700,580)
//   else     
//        openWindowCenterScreen(urlPrefix + "/PhotoGallery/PhotoGalleryImageWindow.aspx?IId=" + ImageId  + "&GId=" + GalleryId + "&Idx=" + Index + "&Link=" + Link,"gallery",700,580)
//window.open(urlPrefix +"/photogallery/default.aspx");
//top.location.href= urlPrefix +"/photogallery/default.aspx";
}
function openWindowCenterScreen(url,name,height,width,hasScroll,hasResize)
{
  var sBars='no';
  var sResise='no';
  if(hasScroll!=null)
    sBars=hasScroll
  if(hasResize!=null)
    sResise=hasResize  
  var w =width; //32;
  var h =height; //96;
  var wleft = (screen.width - w) / 2;
  var wLinks = (screen.height - h) / 2;
  var win = window.open(url,name,
                            'width=' + w + ', height=' + h + ', ' +
                            'left=' + wleft + ', Links=' + wLinks + ', ' +
                            'location=no, menubar=no, ' +
                            'status=no, toolbar=no, scrollbars=' + sBars + ', resizable=' + sResise );
  // Just in case width and height are ignored
  //win.resizeTo(w, h);
  // Just in case left and Links are ignored
  win.moveTo(wleft, wLinks);
  win.focus();    
}
