$(document).ready(function(){
/* rows color interchange */               
  $(".table tr, .our-services p").filter(":odd").addClass(" odd");
  $(".table tr, .our-services p").filter(":even").addClass(" even");
/* /rows color interchange */

	/* custom popup */
	$(function(){
		var isIE = ($.browser.msie && parseInt($.browser.version.substr(0,1)) < 8);
		
		if (isIE) {
			// $('embed, object, select').css('visibility', 'hidden');
		}
		
		$(".custom-popup-wrap").appendTo("body");	
		var viewportwidth;
		var viewportheight;
		
		// the more standards compliant browsers (mozilla/netscape/opera/IE7) use window.innerWidth and window.innerHeight
		if (typeof window.innerWidth != 'undefined'){
			viewportwidth = window.innerWidth,
			viewportheight = window.innerHeight
		}
		
		// IE6 in standards compliant mode (i.e. with a valid doctype as the first line in the document)
		else if (typeof document.documentElement != 'undefined'&& typeof document.documentElement.clientWidth !='undefined' && document.documentElement.clientWidth != 0){
			viewportwidth = document.documentElement.clientWidth,
			viewportheight = document.documentElement.clientHeight
		}
		
		// older versions of IE
		else{
			viewportwidth = document.getElementsByTagName('body')[0].clientWidth,
			viewportheight = document.getElementsByTagName('body')[0].clientHeight
		}
		$(".custom-popup-wrap, .custom-popup").css({"width" : viewportwidth-16 + "px", "height" : viewportheight + "px"});
		// alert('viewportwidth=' + viewportwidth + ', viewportheight=' + viewportheight);
	});
	/* /custom popup */
	
/* hover emulation for IE6 */  
  if($.browser.msie && jQuery.browser.version < "7.0"){
    $(".for-hover").hover(
      function () {
        $(this).addClass(" hover");
      }, 
      function () {
        $(this).removeClass(" hover");
      }
    );
  }
/* /hover emulation for IE6 */

$(".messages .item-read").hover(
	function () {
		$(this).addClass(" item-hover");
		$(this).find('td.action a').css("display","inline");
	}, 
	function () {
		$(this).removeClass(" item-hover");
		$(this).find('td.action a').css("display","none");
	}
);

$(".friends tr, .employers tr").hover(
	function () {
		$(this).addClass(" active");
		$(this).find('td.action a').css("display","inline");
	}, 
	function () {
		$(this).removeClass(" active");
		$(this).find('td.action a').css("display","none");
	}
);

/* first-child emulation for IE6 */  
  if($.browser.msie && jQuery.browser.version < "7.0"){
    $(".top-menu li:first-child a, .top-menu li:first-child, .menu table tr td:first-child, .menu table tr:first-child, .url-1 li:first-child, .url-3 li:first-child, .url-4 li:first-child, .content-table-1 tbody tr:first-child, .content-table tr td:first-child, .content-table tr th:first-child, .articles .item:first-child, .right-menu-2 li:first-child, .right-menu-3 li:first-child, .faq-examples .dl:first-child, .pager li:first-child, .profile-table tr:first-child, .files-list ul:first-child, .files-list li:first-child").addClass(" first-child");
  }
/* /first-child emulation for IE6 */
/* last-child emulation for all */
 $("table.form tr td:last-child").addClass(" last-child");
/* /last-child emulation for all */
});

/* custom corners */
$(function(){
  //  $('div.roundedBlock').wrap('<div class="roundedBlockWrap"></div>').corner("round 10px").parent().css('padding', '1px').corner("round 10px");
//  $('li.roundedBlock').wrap('<div class="roundedBlockWrap"></div>').corner("round 10px").parent().css('padding', '1px').corner("round 10px");
  $('.roundedBlockhasChild, .roundedBlocknoChild').corner("10px");
  $('.roundedBlockisChildWithRightMenu').corner("7px br bl tl");
  $('.roundedBlockisChildWithLeftMenu').corner("7px br bl tr");
  $('.roundedBlockisChildInner').corner("7px tl tr");
  $('.roundedBlockhasChild .roundedBlockisChild, .roundedBlockisChildOne').corner("7px");
  $('.roundedBlockhasChild .roundedBlockisChild:first-child').css('margin-bottom', '0');
  $('.top-menu li:first').corner("tl bl");
  $('.top-menu li:last').corner("tr br");
  $('.header-2, .footer-1').corner("tr 15px");
  $('.menu, .footer-2').corner("bl 15px");
  $('div.q-search div.fields').wrap('<div class="roundedBlockWrap"></div>').corner("round 3px").parent().css('padding', '1px').corner("round 3px");
  $('.url-2 li').corner("tl tr 7px");
  $('.url-2 li:last-child').css('margin-right','0');
  $('.auth-area-2').corner("10px");
});
/* /custom corners  */

