/*
*------------------------------------------------------------------------------------------+
* COMPANY: Raven Developers 2009
+------------------------------------------------------------------------------------------+
* FILE INFO: Site wide Java Script functions
+------------------------------------------------------------------------------------------+
* WEBSITE: http://www.ravendevelopers.com
+------------------------------------------------------------------------------------------+
* Portions created by Anirudh K. Mahant are Copyright of Raven Developers (C) 2009.
+------------------------------------------------------------------------------------------+
* COPYRIGHT NOTICE:
* The original author(s) retain all the copyrights of this file.
* Portions created by Anirudh K. Mahant (original developer) are Copyright of Raven Developers (C) 2009.
* Portions may contain jQuery JavaScript framework developed by John Resig and other
* community members. More info at http://docs.jquery.com/About
* jQuery LICENSE:
* Copyright (c) 2008 John Resig (jquery.com)
* Dual licensed under the MIT (MIT-LICENSE.txt) and GPL (GPL-LICENSE.txt) licenses.
+-------------------------------------------------------------------------------------------+
*/
/* PNGFix */
(function($){jQuery.fn.pngFix=function(settings){settings=jQuery.extend({blankgif:"blank.gif"},settings);var ie55=(navigator.appName=="Microsoft Internet Explorer"&&parseInt(navigator.appVersion)==4&&navigator.appVersion.indexOf("MSIE 5.5")!=-1);var ie6=(navigator.appName=="Microsoft Internet Explorer"&&parseInt(navigator.appVersion)==4&&navigator.appVersion.indexOf("MSIE 6.0")!=-1);if(jQuery.browser.msie&&(ie55||ie6)){jQuery(this).find("img[src$=.png]").each(function(){jQuery(this).attr("width",jQuery(this).width());jQuery(this).attr("height",jQuery(this).height());var prevStyle="";var strNewHTML="";var imgId=(jQuery(this).attr("id"))?'id="'+jQuery(this).attr("id")+'" ':"";var imgClass=(jQuery(this).attr("class"))?'class="'+jQuery(this).attr("class")+'" ':"";var imgTitle=(jQuery(this).attr("title"))?'title="'+jQuery(this).attr("title")+'" ':"";var imgAlt=(jQuery(this).attr("alt"))?'alt="'+jQuery(this).attr("alt")+'" ':"";var imgAlign=(jQuery(this).attr("align"))?"float:"+jQuery(this).attr("align")+";":"";var imgHand=(jQuery(this).parent().attr("href"))?"cursor:hand;":"";if(this.style.border){prevStyle+="border:"+this.style.border+";";this.style.border="";}if(this.style.padding){prevStyle+="padding:"+this.style.padding+";";this.style.padding="";}if(this.style.margin){prevStyle+="margin:"+this.style.margin+";";this.style.margin="";}var imgStyle=(this.style.cssText);strNewHTML+="<span "+imgId+imgClass+imgTitle+imgAlt;strNewHTML+='style="position:relative;white-space:pre-line;display:inline-block;background:transparent;'+imgAlign+imgHand;strNewHTML+="width:"+jQuery(this).width()+"px;"+"height:"+jQuery(this).height()+"px;";strNewHTML+="filter:progid:DXImageTransform.Microsoft.AlphaImageLoader"+"(src='"+jQuery(this).attr("src")+"', sizingMethod='scale');";strNewHTML+=imgStyle+'"></span>';if(prevStyle!=""){strNewHTML='<span style="position:relative;display:inline-block;'+prevStyle+imgHand+"width:"+jQuery(this).width()+"px;"+"height:"+jQuery(this).height()+"px;"+'">'+strNewHTML+"</span>";}jQuery(this).hide();jQuery(this).after(strNewHTML);});jQuery(this).find("*").each(function(){var bgIMG=jQuery(this).css("background-image");if(bgIMG.indexOf(".png")!=-1){var iebg=bgIMG.split('url("')[1].split('")')[0];jQuery(this).css("background-image","none");jQuery(this).get(0).runtimeStyle.filter="progid:DXImageTransform.Microsoft.AlphaImageLoader(src='"+iebg+"',sizingMethod='scale')";}});jQuery(this).find("input[src$=.png]").each(function(){var bgIMG=jQuery(this).attr("src");jQuery(this).get(0).runtimeStyle.filter="progid:DXImageTransform.Microsoft.AlphaImageLoader"+"(src='"+bgIMG+"', sizingMethod='scale');";jQuery(this).attr("src",settings.blankgif);});}return jQuery;};})(jQuery);

function URLDecode(psEncodeString){var lsRegExp=/\+/g;return unescape(String(psEncodeString).replace(lsRegExp," "));}function ZebraTables(){theTable=jQuery.find("table.zeetable");jQuery(theTable).each(function(i){if(this){jQuery(this).find("tr").each(function(i){var zclass=(i%2==0)?"odd":"even";jQuery(this).addClass(zclass);});}});}function ZebraUL(){theUL=jQuery(document).find("ul.zeeul");jQuery(theUL).each(function(i){if(this){jQuery(this).find("li").each(function(i){var zclass=(i%2==0)?"odd":"even";jQuery(this).addClass(zclass);});}});}function BlurFocusText(){theText=jQuery("input.blur-focus");jQuery(theText).each(function(i){if(this){jQuery(this).blur(function(){if(this.value==""){this.value=this.defaultValue;}});jQuery(this).focus(function(){if(this.value==this.defaultValue){this.value="";}});}});}(function($){$.fn.superSelectify=function(options){var defaults={emptyClass:"empty",firstClass:"first",lastClass:"last",oddClass:"odd",evenClass:"even",nextClass:"next",siblingClass:"sibling",firstChildClass:"first-child",lastChildClass:"last-child",onlyChildClass:"only-child",directChildClass:"child",textInputClass:"text",passwordInputClass:"password",radioInputClass:"radio",checkboxInputClass:"checkbox",submitInputClass:"submit",imageInputClass:"image",resetInputClass:"reset",buttonInputClass:"button",fileInputClass:"file",hoverClass:"hover",manualSelectors:false,forceStylesheetParsing:false,additionalElementHash:{}};var options=$.extend(defaults,options);for(var className in options.additionalElementHash){$(options.additionalElementHash[className]).addClass(className);}function getMatches(CSS){function _match_item(reg,className){var itemMatch=CSS.replace(/[\n\r]/gi,"").match(reg);if(itemMatch){itemMatch=itemMatch.join(", ");}if(itemMatch){$(itemMatch).addClass(className);}}function _match_hover(reg,className){var itemMatch=CSS.replace(/[\n\r]/gi,"").match(reg);if(itemMatch){itemMatch=itemMatch.join(", ");}if(itemMatch){$(itemMatch).hover(function(){$(this).addClass(className);},function(){$(this).removeClass(className);});}}_match_item(/[a-zA-Z0-9._+~#:\s-]*:empty/gi,options.emptyClass);_match_item(/[a-zA-Z0-9._+~#:\s-]*:first[^-]/gi,options.firstClass);_match_item(/[a-zA-Z0-9._+~#:\s-]*:last[^-]/gi,options.lastClass);_match_item(/[a-zA-Z0-9._+~#:\s-]*:nth-child\(odd\)/gi,options.oddClass);_match_item(/[a-zA-Z0-9._+~#:\s-]*:nth-child\(even\)/gi,options.evenClass);_match_item(/[a-zA-Z0-9._+~#:\s-]*?\+\s?[a-zA-Z0-9._+~#:-]*/gi,options.nextClass);_match_item(/[a-zA-Z0-9._+~#:\s-]*?\~\s?[a-zA-Z0-9._+~#:-]*/gi,options.siblingClass);_match_item(/[a-zA-Z0-9._+~#:\s-]*:first-child/gi,options.firstChildClass);_match_item(/[a-zA-Z0-9._+~#:\s-]*:last-child/gi,options.lastChildClass);_match_item(/[a-zA-Z0-9._+~#:\s-]*:only-child/gi,options.onlyChildClass);_match_item(/[a-zA-Z0-9._+~#:\s-]*\>\s?[a-zA-Z0-9._+~#:-]*/gi,options.directChildClass);_match_item(/[a-zA-Z0-9._+~#:\s-]*input\[type="text"\]/gi,options.textInputClass);_match_item(/[a-zA-Z0-9._+~#:\s-]*input\[type="password"\]/gi,options.passwordInputClass);_match_item(/[a-zA-Z0-9._+~#:\s-]*input\[type="radio"\]/gi,options.radioInputClass);_match_item(/[a-zA-Z0-9._+~#:\s-]*input\[type="checkbox"\]/gi,options.checkboxInputClass);_match_item(/[a-zA-Z0-9._+~#:\s-]*input\[type="submit"\]/gi,options.submitInputClass);_match_item(/[a-zA-Z0-9._+~#:\s-]*input\[type="image"\]/gi,options.imageInputClass);_match_item(/[a-zA-Z0-9._+~#:\s-]*input\[type="reset"\]/gi,options.resetInputClass);_match_item(/[a-zA-Z0-9._+~#:\s-]*input\[type="button"\]/gi,options.buttonInputClass);_match_item(/[a-zA-Z0-9._+~#:\s-]*input\[type="file"\]/gi,options.fileInputClass);_match_hover(/[a-zA-Z0-9._+~#:\s-]*:hover/gi,options.hoverClass);var importedCSS=CSS.match(/[a-zA-Z0-9\.\-_\+\s]*import([a-zA-Z0-9\.\-_\+\/]*\.css)/gi);if(importedCSS){var fakeStyleSheet=[];for(stylesheet=0;stylesheet<importedCSS.length;stylesheet++){fakeStyleSheet["href"]=importedCSS[stylesheet];getCSS(fakeStyleSheet);}}}function ruleIterator(sheet){var css=sheet.cssRules;for(var rule=0;rule<css.length;rule++){if(css[rule].styleSheet){getCSS(css[rule].styleSheet);}if(css[rule].selectorText==null){continue;}getMatches(css[rule].selectorText);}}function getCSS(sheet){if(sheet.href){var RELATIVE=/^[\w\.]+[^:]*$/;var docURL=String(window.location);var href=(RELATIVE.test(sheet.href))?(docURL.slice(0,docURL.lastIndexOf("/")+1)+sheet.href):sheet.href;$.ajax({url:href,success:function(response){getMatches(response);}});}else{if(sheet.cssText){getMatches(sheet.cssText);}else{ruleIterator(sheet);}}}if(options.manualSelectors){getMatches(options.manualSelectors);}if(!options.manualSelectors||options.forceStylesheetParsing){if(jQuery.browser.safari&&document.readyState!="complete"){setTimeout(arguments.callee,100);return;}for(stylesheet=0;stylesheet<document.styleSheets.length;stylesheet++){getCSS(document.styleSheets[stylesheet]);}}};})(jQuery);
jQuery(document).ready(function(){
	ZebraTables();ZebraUL();BlurFocusText();
	jQuery(function(){
		var tabContainers=jQuery("div.tabs > div");
		jQuery("div.tabs ul.tabNavigation a").click(function(){
			tabContainers.hide().filter(this.hash).fadeIn("slow");
			jQuery("div.tabs ul.tabNavigation a").removeClass("selected");
			jQuery(this).addClass("selected");
			return false;
		}).filter(":first").click();
	});
	Cufon.replace('.block-promotion h2', {textShadow: '1px 1px #862B7B'});
  jQuery("#main-contents .col-right .content a").hover(
    function(){
      jQuery(this).animate({opacity: 0.5},200);
      jQuery(this).animate({opacity: 1},100);
    },
    function(){
      jQuery(this).animate({opacity: 1},100);
    }
  );
  jQuery('ul.footer-links li').each(function(){
    jQuery(this).after("<li>|</li>");
  });
  jQuery('ul.footer-links li:last-child').remove();
  jQuery("a[rel=external]").each(
    function(){
      if(this.href.indexOf(location.hostname) == -1) {
        jQuery(this).attr('target', '_blank');
      }
    }
  )
});