﻿function callonload(tabName)
{
document.getElementById('tab1').style.display='none';
document.getElementById('tab2').style.display='none';
document.getElementById('tab3').style.display='none';
document.getElementById('tab4').style.display='none';
document.getElementById('tab5').style.display='none';
document.getElementById('tab6').style.display='none';
document.getElementById('tab7').style.display='none';
document.getElementById('tab8').style.display='none';
document.getElementById('tab9').style.display='none';
document.getElementById('tab10').style.display='none';
if(tabName=='tab1')
{document.getElementById('EDysFnct');document.getElementById(tabName).style.display='block';}
else if(tabName=='tab2')
{document.getElementById('HairLoss');document.getElementById(tabName).style.display='block';}
else if(tabName=='tab3')
{document.getElementById('WgthLoss');document.getElementById(tabName).style.display='block';}
else if(tabName=='tab4')
{document.getElementById('QutSmkg');document.getElementById(tabName).style.display='block';}
else if(tabName=='tab5')
{document.getElementById('AntiBitcs');document.getElementById(tabName).style.display='block';}
else if(tabName=='tab6')
{document.getElementById('womens');document.getElementById(tabName).style.display='block';}
else if(tabName=='tab7')
{document.getElementById('BrndProd');document.getElementById(tabName).style.display='block';}
else if(tabName=='tab8')
{document.getElementById('Relaxant');document.getElementById(tabName).style.display='block';}
else if(tabName=='tab9')
{document.getElementById('Relif');document.getElementById(tabName).style.display='block';}
else if(tabName=='tab10')
{document.getElementById('Allergy');document.getElementById(tabName).style.display='block';}}
function changeTabImg(imgID,imgName)
{document.getElementById('EDysFnct').src="http://s2.miid.me/tab1.gif";document.getElementById('HairLoss').src="http://s2.miid.me/tab2.gif";document.getElementById('WgthLoss').src="http://s2.miid.me/tab3.gif";document.getElementById('QutSmkg').src="http://s2.miid.me/tab4.gif";document.getElementById('AntiBitcs').src="http://s2.miid.me/tab5.gif";document.getElementById('womens').src="http://s2.miid.me/tab6.gif";document.getElementById('BrndProd').src="http://s2.miid.me/tab7.gif";document.getElementById(imgID).src="http://s2.miid.me/"+imgName+"_mouseover.gif";}
$.fn.rater=function(options){var opts=$.extend({},$.fn.rater.defaults,options);return this.each(function(){var $this=$(this);var $on=$this.find('.ui-rater-starsOn');var $off=$this.find('.ui-rater-starsOff');if(opts.size==undefined)opts.size=$off.height();if(opts.rating==undefined)opts.rating=$on.width()/opts.size;if(opts.id==undefined)opts.id=$this.attr('id');$off.mousemove(function(e){var left=e.clientX-$off.offset().left;var width=$off.width()-($off.width()-left);width=Math.min(Math.ceil(width/(opts.size/opts.step))*opts.size/opts.step,opts.size*opts.ratings.length)
$on.width(width);var r=Math.round($on.width()/$off.width()*(opts.ratings.length*opts.step))/opts.step;$this.attr('title',opts.ratings[r-1]==undefined?r:opts.ratings[r-1]);}).hover(function(e){$on.addClass('ui-rater-starsHover');},function(e){$on.removeClass('ui-rater-starsHover');$on.width(opts.rating*opts.size);}).click(function(e){var r=Math.round($on.width()/$off.width()*(opts.ratings.length*opts.step))/opts.step;$.fn.rater.rate($this,opts,r);}).css('cursor','pointer');$on.css('cursor','pointer');});};$.fn.rater.defaults={postHref:location.href,ratings:['Bad','Boring','Average','Good','Great'],step:1};$.fn.rater.rate=function($this,opts,rating){var $on=$this.find('.ui-rater-starsOn');var $off=$this.find('.ui-rater-starsOff');$off.fadeTo(600,0.4,function(){$.ajax({url:opts.postHref,type:"POST",data:'id='+opts.id+'&rating='+rating,complete:function(req){if(req.status==200){opts.rating=parseFloat(req.responseText);$off.unbind('click').unbind('mousemove').unbind('mouseenter').unbind('mouseleave');$off.css('cursor','default');$on.css('cursor','default');$off.fadeTo(600,0.1,function(){$on.removeClass('ui-rater-starsHover').width(opts.rating*opts.size);var $count=$this.find('.ui-rater-rateCount');if($count){$count.text(parseInt($count.text())+1);$this.find('.ui-rater-rating').text(opts.rating.toFixed(1));}
$off.fadeTo(500,1);$this.attr('title','Your rating: '+rating.toFixed(1));});}else{alert(req.responseText);$off.fadeTo(2200,1);}}});});};function initMenu(){$('#menu ul').hide();$('#menu ul:first').show();$('#menu li a').click(function(){var checkElement=$(this).next();if((checkElement.is('ul'))&&(checkElement.is(':visible'))){return false;}
if((checkElement.is('ul'))&&(!checkElement.is(':visible'))){$('#menu ul:visible').slideUp('normal');checkElement.slideDown('normal');return false;}});}
$(document).ready(function(){initMenu();});$(function(){$(".ui-tabs").tabs();});$(function(){$('#testRater').rater({postHref:'rating.aspx'});});$(document).ready(function(){$("ul.thumb li").hover(function(){$(this).css({'z-index':'10'});$(this).find('img').addClass("hover").stop().animate({marginTop:'-120px',marginLeft:'-60px',top:'50%',left:'50%',width:'218px',height:'171px',padding:'20px'},200);},function(){$(this).css({'z-index':'0'});$(this).find('img').removeClass("hover").stop().animate({marginTop:'0',marginLeft:'0',top:'0',left:'0',width:'41px',height:'34px',padding:'5px'},400);});$("ul.thumb li a").click(function(){var mainImage=$(this).attr("href");$("#main_view img").attr({src:mainImage});return false;});});
