
var $j = jQuery.noConflict();
/*
 $j(function(){
 
 var Tabs = {
 '<img src="images/main/btn_01_off.gif" class="tabImage" />' : 'view/view1.html',
 '<img src="images/main/btn_02_off.gif" class="tabImage" />'	: 'view/view2.html',
 '<img src="images/main/btn_03_off.gif" class="tabImage" />'	: 'view/view3.html',
 '<img src="images/main/btn_space.gif" class="" />'	: 'view/view0.html',
 '<img src="images/main/btn_04_off.gif" class="tabImage" />'	: 'view/view4.html',
 '<img src="images/main/btn_05_off.gif" class="tabImage" />'	: 'view/view5.html'
 };
 
 var colors = ['blue','green','red','orange'];
 
 var topLineColor = {
 blue:'lightblue',
 green:'lightgreen',
 red:'red',
 orange:'orange'
 };
 
 var z=0;
 $j.each(Tabs,function(i,j){
 var tmp = $j('<li><a href="#" class="tab '+colors[(z++%4)]+'">'+i+' <span class="left" /><span class="right" /></a></li>');
 
 tmp.find('a').data('view',j);
 $j('ul.main-menu').append(tmp);
 });
 var the_tabs = $j('.tab');
 
 the_tabs.click(function(e){
 
 //$j(this).find('img').attr('src', $j(this).find('img').attr('src').replace('off.gif', 'on.gif'));
 
 //var src = ($j(this).find('img').attr("src") === "img1_on.jpg") ? "img2_on.jpg" : "img1_on.jpg";
 //$j(this).attr("src", src);
 
 var element = $j(this);
 if(element.find('#overLine').length) return false;
 
 var bg = element.attr('class').replace('tab ','');
 $j('#overLine').remove();
 
 $j('<div>',{
 id:'overLine',
 css:{
 display:'none',
 width:element.outerWidth()-2,
 background:topLineColor[bg] || 'white'
 }}).appendTo(element).fadeIn('slow');
 
 
 if(!element.data('cache'))
 {
 $j('#content-holder').html('<img src="images/etc/loading.gif" width="66" height="66" class="preloader" />');
 $j.get(element.data('view'),function(msg){
 $j('#content-holder').html(msg);
 
 element.data('cache',msg);
 });
 }
 else $j('#content-holder').html(element.data('cache'));
 
 e.preventDefault();
 });
 
 the_tabs.eq(3).click();
 });
 (function($j){
 jQuery.fn.vibrate = function(conf){
 var config = jQuery.extend({
 speed: 30,
 duration: 2000,
 frequency: 10000,
 spread: 0
 }, conf);
 
 return this.each(function(){
 var t = jQuery(this);
 
 var vibrate = function(){
 var topPos = Math.floor(Math.random() * config.spread) - ((config.spread - 1) / 2);
 var leftPos = Math.floor(Math.random() * config.spread) - ((config.spread - 1) / 2);
 var rotate = Math.floor(Math.random() * config.spread - (config.spread - 1) / 2);
 t.css({
 position: 'relative',
 left: leftPos + 'px',
 top: topPos + 'px',
 WebkitTransform: 'rotate(' + rotate + 'deg)'
 });
 };
 
 var doVibration = function(){
 
 var vibrationInterval = setInterval(vibrate, config.speed);
 
 var stopVibration = function(){
 clearInterval(vibrationInterval);
 t.css({
 position: 'static'
 });
 };
 
 setTimeout(stopVibration, config.duration);
 };
 //setInterval(doVibration, config.frequency);
 doVibration();
 });
 };
 })(jQuery);
 */
$j(function(){

    $j('img.tabImage').hover(function(){
        $j(this).attr('src', $j(this).attr('src').replace('off.gif', 'on.gif'));
    }, function(){
        $j(this).attr('src', $j(this).attr('src').replace('on.gif', 'off.gif'));
    });
    
});

$j(function(){
    $j(".upcontent").colorbox({
        iframe: true,
        width: 640,
        height: 480,
        initialWidth: 570,
        innerHeight: 343,
        opacity: 0.5,
        scrolling: false,
        overlayClose: false
    });
    $j(".upcontents").colorbox({
        iframe: true,
        width: 616,
        height: 500,
        initialWidth: 570,
        innerHeight: 343,
        opacity: 0.5,
        scrolling: false,
        overlayClose: false
    });
    $j("a[rel='dungeons']").colorbox({
		current: '',
		previous: '',
		next: ''
	});
    $j("a[rel='mission1']").colorbox();
    $j("a[rel='mission2']").colorbox({
        current: '',
        previous: '',
        next: ''
    });
    $j("a[rel='act2-monster']").colorbox({
		current: '',
		previous: '',
		next: ''
    });
    $j("a[rel='act2-item']").colorbox({
		current: '',
		previous: '',
		next: ''
    });
});

$j(function(){
     $j('#item').galleryView({
     filmstrip_size: 6,
     transition_interval: 1200,
     frame_width: 116,
     frame_height: 116,
     background_color: 'transparent',
     nav_theme: 'dark',
     border: 'none',
     show_captions:false,
	 frame_margin: 0,
     caption_text_color: 'black'
     });
});

<!--
function setCookieForToday(name, value){
    var dtToday = new Date();
    dtToday.setDate(dtToday.getDate() + 1);
    dtToday.setHours(0, 0, 0, 0);
    document.cookie = name + "=" + escape(value) + "; path=/; expires=" + dtToday.toGMTString() + ";";
}

function pCookie(name){

    var nameOfCookie = name + "=";
    var x = 0;
    while (x <= document.cookie.length) {
        var y = (x + nameOfCookie.length);
        if (document.cookie.substring(x, y) == nameOfCookie) {
            if ((endOfCookie = document.cookie.indexOf(";", y)) == -1) {
                endOfCookie = document.cookie.length;
            }
            return unescape(document.cookie.substring(y, endOfCookie));
        }
        x = document.cookie.indexOf(" ", x) + 1;
        if (x == 0) {
            break;
        }
    }
    return "";
}

//-->

$j(function(){
    $j('.temp-cookie img').click(function(){
        $j(this).attr('src', $j(this).attr('src').replace('off.gif', 'on.gif'));
        setCookieForToday("GCSN3", "HelloJason");
        setTimeout(function(){
            location.href = 'cookieEx.aspx';
        }, 500);
    });
});

$j(function(){
	var share_tmp = $j('<div id="share-twt"></div><div id="share-fb"><a href="#" rel="share-fb"></a></div>');
 	$j('.main-top').append(share_tmp);
//    title = $j('title').text() || document.title;
	title = 'Crazy new monsters! Awesome new dungeons! Grand Chase Season 3 is out!';
    currentUrl = window.location.href;
    $j('#share-twt').click(function(){
		window.open("http://twitter.com" + "/home?status=" + title + ": " + currentUrl,"twtwindow");
    });
    $j('#share-fb').click(function(){
		window.open("http://www.facebook.com" + "/sharer.php?u=" + currentUrl + "&t=" + title,"fbwindow");
    });
});



