﻿// JScript File

function GB_showCenter(a,url,flag,c)
{
//alert(url);
//alert(flag);
  var myWidth = 0, myHeight = 0;
  
  if( typeof( window.innerWidth ) == 'number' ) 
  {
    //Non-IE
    myWidth = window.innerWidth;
    myHeight = window.innerHeight;
  } 
  else if( document.documentElement && ( document.documentElement.clientWidth || document.documentElement.clientHeight ) )
   {
    //IE 6+ in 'standards compliant mode'
    myWidth = document.documentElement.clientWidth;
    myHeight = document.documentElement.clientHeight;
  }
   else if( document.body && ( document.body.clientWidth || document.body.clientHeight ) ) 
   {
    //IE 4 compatible
    myWidth = document.body.clientWidth;
    myHeight = document.body.clientHeight;
   }
//alert(myWidth);
//alert(myHeight);
//Calculating final values
  finalwidth=myWidth*.9;
  finalheight=myHeight*.9;
  
//alert(finalwidth);
//alert(finalheight);

//sethref=gethref + "&height=" + finalheight + "&width=" + finalwidth;

//setvalue.href=sethref;

//--------------------------------******------------------------------


    var index=parseInt(url.indexOf('?'));
//        alert(index);  


 if (flag==3)   /// for Leave comment popup .... Special case 3
    {
    url1 = url + '&KeepThis=true&TB_iframe=true&height=450&width=425&modal=true';   

    tb_show(a, url1);
    }
    else if (flag==2)   /// for request comment popup .... Special case 2
    {
    url1 = url + '&KeepThis=true&TB_iframe=true&height=250&width=425&modal=true';   

    tb_show(a, url1);
    }
    else if(index==-1 && flag!=1)
    {
//    alert('1');
     url1 = url + '?KeepThis=true&TB_iframe=true&height=' + finalheight + '&width=' + finalwidth + '&modal=true';    
     tb_show(a, url1);
    }
    else if(index!=-1 && flag!=1)
    {
//    alert('2');
    url1 = url + '&KeepThis=true&TB_iframe=true&height=' + finalheight + '&width=' + finalwidth + '&modal=true';    
    tb_show(a, url1);
    }
    
    else if(index==-1 && flag==1)
    {
//    alert('3');
    url1 = url + '?KeepThis=true&TB_iframe=true&height=175&width=425&modal=true';    
    tb_show(a, url1);
    }
    else if(index!=-1 && flag==1)
    {
//   alert('4');
//    alert(url);
     url1 = url + '&KeepThis=true&TB_iframe=true&height=175&width=425&modal=true';   
//    alert(url1);  
    tb_show(a, url1);
    }
    
    return false;

}


function GB_hide()
{
    tb_remove(); 
}
