
function MM_swapImgRestore() { //v3.0
  var i,x,a=document.MM_sr; for(i=0;a&&i<a.length&&(x=a[i])&&x.oSrc;i++) x.src=x.oSrc;
}

function MM_preloadImages() { //v3.0
  var d=document; if(d.images){ if(!d.MM_p) d.MM_p=new Array();
    var i,j=d.MM_p.length,a=MM_preloadImages.arguments; for(i=0; i<a.length; i++)
    if (a[i].indexOf("#")!=0){ d.MM_p[j]=new Image; d.MM_p[j++].src=a[i];}}
}

function MM_findObj(n, d) { //v4.01
  var p,i,x;  if(!d) d=document; if((p=n.indexOf("?"))>0&&parent.frames.length) {
    d=parent.frames[n.substring(p+1)].document; n=n.substring(0,p);}
  if(!(x=d[n])&&d.all) x=d.all[n]; for (i=0;!x&&i<d.forms.length;i++) x=d.forms[i][n];
  for(i=0;!x&&d.layers&&i<d.layers.length;i++) x=MM_findObj(n,d.layers[i].document);
  if(!x && d.getElementById) x=d.getElementById(n); return x;
}

function MM_swapImage() { //v3.0
  var i,j=0,x,a=MM_swapImage.arguments; document.MM_sr=new Array; for(i=0;i<(a.length-2);i+=3)
   if ((x=MM_findObj(a[i]))!=null){document.MM_sr[j++]=x; if(!x.oSrc) x.oSrc=x.src; x.src=a[i+2];}
}

function mm_swapimgrestore() { //v3.0
  var i,x,a=document.mm_sr; for(i=0;a&&i<a.length&&(x=a[i])&&x.oSrc;i++) x.src=x.oSrc;
}

function mm_preloadimages() { //v3.0
  var d=document; if(d.images){ if(!d.mm_p) d.mm_p=new Array();
    var i,j=d.mm_p.length,a=mm_preloadimages.arguments; for(i=0; i<a.length; i++)
    if (a[i].indexOf("#")!=0){ d.mm_p[j]=new Image; d.MM_p[j++].src=a[i];}}
}

function mm_findobj(n, d) { //v4.01
  var p,i,x;  if(!d) d=document; if((p=n.indexOf("?"))>0&&parent.frames.length) {
    d=parent.frames[n.substring(p+1)].document; n=n.substring(0,p);}
  if(!(x=d[n])&&d.all) x=d.all[n]; for (i=0;!x&&i<d.forms.length;i++) x=d.forms[i][n];
  for(i=0;!x&&d.layers&&i<d.layers.length;i++) x=mm_findobj(n,d.layers[i].document);
  if(!x && d.getElementById) x=d.getElementById(n); return x;
}

function mm_swapimage() { //v3.0
  var i,j=0,x,a=mm_swapimage.arguments; document.mm_sr=new Array; for(i=0;i<(a.length-2);i+=3)
   if ((x=mm_findobj(a[i]))!=null){document.mm_sr[j++]=x; if(!x.oSrc) x.oSrc=x.src; x.src=a[i+2];}
}


function mailpage()
{
	//alert(location.href);
	
	//var thearticle=location.href;
	//alert(thearticle);
	
	mail_str = "mailto:?subject= " + document.title;
	//alert(mail_str);
	  mail_str += "&body= I recommend this Article: " + document.title;
	 
	  mail_str += ". You should check it out at " + location.href;
	  location.href = mail_str;

}

function mailpageURL(URL)
{
	//alert(URL);
	//alert(location.href);
	var thesite="http://dev.winexpert.com/";
	//var thearticle=location.href;
	//alert(thearticle);
	
	mail_str = "mailto:?subject= " + document.title;
	//alert(mail_str);
	  mail_str += "&body= I recommend this Article: " + document.title;
	 
	  mail_str += ". You should check it out at: " +thesite+URL;
	  location.href = mail_str;

}

$(document).ready(function() {
	var IE6 = false /*@cc_on || @_jscript_version < 5.7 @*/;

	$("#request").bind("mouseenter",function(){
		if ($("#request").css('width') == '31px') {
		
			if (IE6) {
				$('#request').find('#requestTab').css('display','none');
				$('#request').find('#requestBody').css('display','block');
			}
			else {
				$("#requestTab").fadeOut('fast');
				$('#requestBody').css('width', '0px').animate({
					"width": "231px",
					"opacity": 1
				}, {
					duration: "slow"
				});
				$("#request").css('width', '231px');
			}
		}
	}).bind("mouseleave",function() {
		if (IE6) {
			$('#request').find('#requestTab').css('display','block');
			$('#request').find('#requestBody').css('display','none');
		}
		else {
			$('#requestBody').animate({"width": "0px", "opacity": 1}, {
				duration: "slow"
			});
			$("#requestTab").fadeIn('fast');
			$("#request").css('width','31px');
		}
	});
	
	
	$("#contact").bind("mouseenter",function(){
		if ($("#contact").css('width') == '31px') {
			if (IE6) {
				$('#contact').find('#contactTab').css('display','none');
				$('#contact').find('#contactBody').css('display','block');
			}
			else {
				$("#contactTab").fadeOut('fast');
				$('#contactBody').css('width', '0px').animate({
					"width": "231px",
					"opacity": 1
				}, {
					duration: "slow"
				});
				$("#contact").css('width', '231px');
			}
		}
	}).bind("mouseleave",function() {
		if (IE6) {
			$('#contact').find('#contactTab').css('display','block');
			$('#contact').find('#contactBody').css('display','none');
		}
		else {
			$('#contactBody').animate({"width": "hide", "opacity": 1}, { 
				duration: "slow"	
			});
			$("#contactTab").fadeIn('fast');
			$("#contact").css('width','31px');
		}
	});
	
	$('h1,h4').flash(
        { 
            src: '~assets/flash/jfr.swf', 
            flashvars: { 
                css: [
                    '* { color: #5eae46; }',
                    'a { color: #5EAE46; text-decoration: none; }',
                    'a:hover { color: #333333; }'
                ].join(' ')
            },
			wmode:'transparent'
        },
        { version: 7 },
        function(htmlOptions) {
			htmlOptions.flashvars.txt = this.innerHTML.replace(/<br\/>/ig,"");
            htmlOptions.flashvars.txt = this.innerHTML;
            this.innerHTML = '<div>'+this.innerHTML+'</div>';
            var $alt = $(this.firstChild);
            htmlOptions.height = parseInt($alt.css('font-size'));
            htmlOptions.width = $alt.width();
            $alt.addClass('alt');
            $(this)
                .addClass('flash-replaced')
                .prepend($.fn.flash.transform(htmlOptions)).show('fast');						
        }
    );
	
	if ($('#insideRight blockquote') != 'undefined') {
		var numOfBlocks = $('#insideRight blockquote').length;
		var randNum = Math.floor(numOfBlocks * Math.random());
		
		for (i = 0; i < numOfBlocks; i++) {
			if (i != randNum) {
				$('#insideRight blockquote')[i].style.display = 'none';
			}
		}
	}
	
});

function clearText(obj) {
	obj.value = '';
}

function setText(obj) {
	if (obj.value.length == 0)
		obj.value = 'Site Search'; 
}

function reqHover() {
	document.getElementById('submit').src = '~ASSETS/IMG/layout/search_button_popup_hover.jpg';
}

function reqNormal() {
	document.getElementById('submit').src = '~ASSETS/IMG/layout/search_button_popup.jpg';
}

function searchHover() {
	document.getElementById('searchSubmit').src = '~ASSETS/IMG/layout/search_button_hover.jpg';
}

function searchNormal() {
	document.getElementById('searchSubmit').src = '~ASSETS/IMG/layout/search_button.jpg';
}

function feedHover() {
	document.getElementById('feed').src = '~ASSETS/IMG/layout/feed_button_hover.jpg';
}

function feedNormal() {
	document.getElementById('feed').src = '~ASSETS/IMG/layout/feed_button.jpg';
}

function backHover() {
	document.getElementById('back').src = '~ASSETS/IMG/layout/back_button_hover.gif';
}

function backNormal() {
	document.getElementById('back').src = '~ASSETS/IMG/layout/back_button.gif';
}

function newsHover(id) {
	document.getElementById(id).src = '~ASSETS/IMG/layout/news_button_hover.jpg';
}

function newsNormal(id) {
	document.getElementById(id).src = '~ASSETS/IMG/layout/news_button.jpg';
}

function finalSubmitHover() {
	document.getElementById('finalSubmit').src = '~ASSETS/IMG/layout/submit_mo.jpg';
}

function finalSubmitNormal() {
	document.getElementById('finalSubmit').src = '~ASSETS/IMG/layout/submit.jpg';
}

