﻿// JScript File
function live_click() {
	 window.open('https://skydrive.live.com/sharefavorite.aspx%2f.SharedFavorites??mkt=en-us&url='+encodeURIComponent(location.href));
	return false;
}

function fbs_click() 
{
    window.open('http://www.facebook.com/sharer.php?u='+encodeURIComponent(location.href)+'&t='+encodeURIComponent(document.title),'sharer','toolbar=0,status=0,width=626,height=436');
    return false;
}
function delicious_click()
{ 
	window.open('http://delicious.com/save?v=5&amp;noui&amp;jump=close&amp;url='+encodeURIComponent(location.href)+'&amp;title='+encodeURIComponent(document.title), 'delicious','toolbar=no,width=550,height=550');
	return false;
}
function linkedin_click()
{ 
	window.open('http://www.linkedin.com/shareArticle?mini=true&url='+encodeURIComponent(location.href)+'&amp;title='+encodeURIComponent(document.title), 'linkedIn','toolbar=no,width=550,height=550');
	return false;
}
function digg_click()
{ 
	window.open('http://digg.com/submit?url='+encodeURIComponent(location.href)+'&amp;title='+encodeURIComponent(document.title), 'Digg','toolbar=no,width=550,height=550');
	return false;
}

function sitefeedback_click()
{ 
	window.open('sitefeedback.htm', '_blank','location=no,toolbar=no,width=650,height=550');
	
	return false;
}
function thankyou_click()
{ 
	window.open('thank_you.aspx','_blank','location=no,toolbar=no, scrollbars=no, menubar=no, top=600, width=260,height=180');
	
	return false;
}
//=================YES NO================//

function popup(obj)
{
    obj = document.getElementById('thankyou');
    obj.style.visibility = 'visible';
    setTimeout('fadeOut()',500);
}
function fadeOut(){
    $('#thankyou').animate({'opacity':'0'},500);
}
//=================FEEDBACK FORM================//


/**
*	akModal-  simplest alternative to thickbox
*	author: Amit Kumar Singh 
* 	project url : http://amiworks.co.in/talk/akmodal-simplest-alternative-to-thickbox/
 * 	inspired from early versions of thickbox
 *	
**/
/**
  * Version 2.0.0
  *  @param String  navurl             url to dispaly in the ifame
  *  @param String  title      title of the pop up box
  *  @param  Numeric  box_width	width of the box in pixels
  *  @param  Numeric  box_height	height of the box in pixels
  *   
 **/

jQuery.extend({
	
	showAkModal:function(navurl,title,box_width,box_height)
	{
	    var offset={};
	    var options ={
	    margin:1,
	    border:5,
	    padding:1,
	    scroll:0
	    };
		
	    var win_width =$(window).width();
	    var scrollToLeft=$(window).scrollLeft();
	    var win_height =$(window).height();
	    var scrollToBottom=$(window).scrollTop();
	    //var stilo= 'position:absolute; padding:2px; background-position:0 0;background-repeat:no-repeat;background-image:url(\'../images/feedback_box.png\');width:408px;height:414px;z-index:8000;"><div id="close" style="position:absolute; height: 25px width: 25px; background-repeat:no-repeat;background-color:red; background-image: url(\'../images/close_x.png\');right: 30px; cursor:pointer;';
		//var myhtml='<div id="feedbackcontainer" style="'+stilo+'"><iframe width="'+box_width+'" height="'+box_height+'"  frameborder="0" marginwidth="0" marginheight="0" scrolling="NO"  name="frmTest" src="'+navurl+'"></iframe></div>';	   
	   	var myhtml='<div id="feedbackcontainer" style="position:absolute; padding:2px; background-position:0 0;background-repeat:no-repeat;background-image:url(\'images/feedback_box.png\');width:408px;height:414px;z-index:8000;"><div id="close" style="position:absolute; height: 25px; width: 25px; background-repeat:no-repeat; background-image: url(\'images/close_x.png\');right: 30px; cursor:pointer;"></div><iframe width="'+box_width+'" height="'+box_height+'"  frameborder="0" marginwidth="0" marginheight="0" scrolling="NO"  id="frmTest" src="'+navurl+'"></iframe></div>';	   

		//alert(myhtml);	   
	   $('body').append(myhtml);

	    $('#feedbackcontainer').css({left:(((win_width/2-box_width/2))+scrollToLeft)+'px',top:(((win_height/2-box_height/2))+scrollToBottom)+'px'});
	  
	    $('#close').click( function() {
	       $('#feedbackcontainer').fadeOut(500);
	      setTimeout("$('#feedbackcontainer').remove();", 500);
	    });
	    
	    
	     $('#submitted').click( function() {
	     alert('here');
	       $('#feedbackcontainer').fadeOut(500);
	      setTimeout("$('#feedbackcontainer').remove();", 500);
	    });


		$('#feedbackcontainer').fadeIn(500);
	    
		var offset = {}
	    offset=$("#feedbackcontainer").offset({ scroll: false })
	    X_left=offset.left+box_width-16;
	    X_top=offset.top;
	},
	
	akModalRemove:function(){
	   $('#feedbackcontainer').fadeOut(500);
	},
	
	akModalHideAndRedirect:function(redirect_url){
	    $('#feedbackcontainer').fadeOut(500);
	    $.dimScreenStop();
	    window.location=redirect_url;
	}
});	

function closeMe(){
	document.getElementById("closeDD").value = "close";
	document.getElementById("mask").innerHTML = "<div style='background-image:url(\"images/fbb_thankyou.gif\");width:404px;height:414px;'></div>";
	
	setTimeout("login.submit();",800);
	setTimeout("window.close();",800);	
	
}

