// JavaScript Document
function checkAll() 
{
 var val; 
 val = document.frm.checkall.checked; 
 dml=document.frm; 
 len = dml.elements.length; 
 var i=0;
 for( i=0 ; i<len ; i++)
  {
   dml.elements[i].checked=val;
  }
}

function checkAll_buy() 
{
 var val; 
 val = document.frm1.checkall_buy.checked; 
 dml=document.frm1; 
 len = dml.elements.length; 
 var i=0;
 for( i=0 ; i<len ; i++)
  {
   dml.elements[i].checked=val;
  }
}


_editor_url = "";
var win_ie_ver = parseFloat(navigator.appVersion.split("MSIE")[1]);
if (navigator.userAgent.indexOf('Mac')        >= 0) { win_ie_ver = 0; }
if (navigator.userAgent.indexOf('Windows CE') >= 0) { win_ie_ver = 0; }
if (navigator.userAgent.indexOf('Opera')      >= 0) { win_ie_ver = 0; }
if (win_ie_ver >= 5.5) {
 document.write('<scr' + 'ipt src="' +_editor_url+ 'editor.js"');
 document.write(' language="Javascript1.2"></scr' + 'ipt>');  
} else { document.write('<scr'+'ipt>function editor_generate() { return false; }</scr'+'ipt>'); }

function nav_url(url)
{
var url = url;
  //<--
 if(navigator.userAgent.indexOf("Firefox") != -1)
{
   window.location = url;
}
else if(navigator.userAgent.indexOf("MSIE") != -1)
{
   window.location = url;
   alert("enter");
}
else if(navigator.userAgent.indexOf("Netscape") != -1)
{
   window.location = url;
}
else
{
    document.location.href=url;
}

}

function chk()
{
if((document.frm.pnumber.value > document.frm.hid_allpage.value) || (document.frm.pnumber.value <= 0))
{
alert("Please Select the number between 1 and "+ document.frm.hid_allpage.value);
return false;
}
}







startList = function() {
if (document.all&&document.getElementById) {
cssdropdownRoot = document.getElementById("cssdropdown");
for (x=0; x<cssdropdownRoot.childNodes.length; x++) {
node = cssdropdownRoot.childNodes[x];
if (node.nodeName=="LI") {
node.onmouseover=function() {
this.className+=" over";
}
node.onmouseout=function() {
this.className=this.className.replace(" over", "");
}
}
}
}
}

if (window.attachEvent)
window.attachEvent("onload", startList)
else
window.onload=startList;




function showmenu(a)
{
if(a==1)
	document.getElementById("dropmenu1").style.display='';
if(a==2)
	document.getElementById("dropmenu1").style.display='none';

}
$(document).ready(function() {
	//Code goes here
	$('a.poplight[href^=#]').click(function() {
    var popID = $(this).attr('rel'); //Get Popup Name
    var popURL = $(this).attr('href'); //Get Popup href to define size

    //Pull Query & Variables from href URL
    var query= popURL.split('?');
    var dim= query[1].split('&');
    var popWidth = dim[0].split('=')[1]; //Gets the first query string value

    //Fade in the Popup and add close button
    $('#' + popID).fadeIn().css({ 'width': Number( popWidth ) }).prepend('<a href="#" class="close"><img src="images/cross.gif" class="btn_close" title="Close Window" alt="Close" broder=0/></a>');

    //Define margin for center alignment (vertical   horizontal) - we add 80px to the height/width to accomodate for the padding  and border width defined in the css
    var popMargTop = ($('#' + popID).height() + 80) / 2;
    var popMargLeft = ($('#' + popID).width() + 80) / 2;

    //Apply Margin to Popup
    $('#' + popID).css({
        'margin-top' : -popMargTop,
        'margin-left' : -popMargLeft
    });

    //Fade in Background
    $('body').append('<div id="fade"></div>'); //Add the fade layer to bottom of the body tag.
    $('#fade').css({'filter' : 'alpha(opacity=80)'}).fadeIn(); //Fade in the fade layer - .css({'filter' : 'alpha(opacity=80)'}) is used to fix the IE Bug on fading transparencies 

    return false;
});

//Close Popups and Fade Layer
$('a.close, #fade').live('click', function() { //When clicking on the close or fade layer...
    $('#fade , .popup_block').fadeOut(function() {
        $('#fade, a.close').remove();  //fade them both out
    });
    return false;
});




});





